Hello Dear all,
I have newly started using pytorch. Actually my question is not completely related to pytorch.
I want to know the image whether consist a specific object or not. Simply I mean, does a picture consist a Plane?
To determining this and using cnn, what should the number of output class be? My code is posted below. I bolded the output class number as “1”.
This method gives the below error:
File “/usr/local/lib/python2.7/dist-packages/torch/autograd/variable.py”, line 156, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph, retain_variables)
File “/usr/local/lib/python2.7/dist-packages/torch/autograd/init.py”, line 98, in backward
variables, grad_variables, retain_graph)
RuntimeError: cuda runtime error (59) : device-side assert triggered at /pytorch/torch/lib/THC/THCTensorCopy.cu:100
Thank you all.

class Net(nn.Module):
def init(self):
super(Net, self).init()
self.pool = nn.MaxPool2d(2, 2)
self.conv1 = nn.Conv2d(3, 10, 5)
self.conv2 = nn.Conv2d(10, 20, 5)
self.fc1 = nn.Linear(20 * 5 * 5, 256)
self.fc2 = nn.Linear(256, 1)
def forward(self, x):
    # print x.size()
    x = self.pool(F.relu(self.conv1(x)))
    x = self.pool(F.relu(self.conv2(x)))
    x = x.view(-1, 20*5*5) # flatten the sensor
    x = F.relu(self.fc1(x))
    x = self.fc2(x)
    return F.log_softmax(x)