Skip to content

Instantly share code, notes, and snippets.

@geoffreygarrett
Created May 24, 2019 19:32
Show Gist options
  • Save geoffreygarrett/bb78c37b448beef03321f232278950e9 to your computer and use it in GitHub Desktop.
Save geoffreygarrett/bb78c37b448beef03321f232278950e9 to your computer and use it in GitHub Desktop.
running CNN_Class.py
/usr/bin/python3 /home/ggarrett/Repositories/DeepLearning/CNN_Class.py
LOADING DATA...
DATA LOADING SUCCESSFUL
PRESS ENTER TO START TRAINING
Net(
(conv0): Conv2d(3, 6, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(pool): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
(conv1): Conv2d(6, 16, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(conv2): Conv2d(16, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
(fc0): Linear(in_features=1152, out_features=120, bias=True)
(fc1): Linear(in_features=120, out_features=84, bias=True)
(fc2): Linear(in_features=84, out_features=40, bias=True)
)
epoch 1:
[1, 200] loss: 3.686
[1, 400] loss: 3.686
[1, 600] loss: 3.682
[1, 800] loss: 3.675
[1, 1000] loss: 3.673
/usr/local/lib/python3.6/dist-packages/numpy/core/fromnumeric.py:3118: RuntimeWarning: Mean of empty slice.
out=out, **kwargs)
/usr/local/lib/python3.6/dist-packages/numpy/core/_methods.py:85: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
nan
epoch 2:
[2, 200] loss: 3.669
[2, 400] loss: 3.663
[2, 600] loss: 3.668
[2, 800] loss: 3.662
[2, 1000] loss: 3.662
0.0041668072292933836
epoch 3:
[3, 200] loss: 3.655
[3, 400] loss: 3.651
[3, 600] loss: 3.661
[3, 800] loss: 3.655
[3, 1000] loss: 3.654
0.0034026762285392148
epoch 4:
[4, 200] loss: 3.650
[4, 400] loss: 3.656
[4, 600] loss: 3.650
[4, 800] loss: 3.651
[4, 1000] loss: 3.652
0.002588764131346164
epoch 5:
[5, 200] loss: 3.657
[5, 400] loss: 3.652
[5, 600] loss: 3.637
[5, 800] loss: 3.654
[5, 1000] loss: 3.656
0.0019860306141165317
epoch 6:
[6, 200] loss: 3.653
[6, 400] loss: 3.650
[6, 600] loss: 3.651
[6, 800] loss: 3.661
[6, 1000] loss: 3.640
0.0009572997501002384
epoch 7:
Traceback (most recent call last):
File "/home/ggarrett/Repositories/DeepLearning/CNN_Class.py", line 180, in <module>
dim2)
File "/home/ggarrett/Repositories/DeepLearning/CNN_Class.py", line 136, in __init__
outputs = net(images)
File "/home/ggarrett/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
result = self.forward(*input, **kwargs)
File "/home/ggarrett/Repositories/DeepLearning/cnn2.py", line 54, in forward
x=self.pool(F.relu(getattr(self, f"conv{i}")(x)))
File "/home/ggarrett/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
result = self.forward(*input, **kwargs)
File "/home/ggarrett/.local/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 338, in forward
self.padding, self.dilation, self.groups)
RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same
Process finished with exit code 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment