Hello,
i would like to get some advice about what am i doing wrong.
I loaded data and created the tensors, and then i´m using dataloader.
When i want to make forward with my CNN, i get this error:
TypeError: conv2d(): argument ‘input’ (position 1) must be Tensor, not tuple
Conv2d is the first layer in the network. I also printed my input for model in forward function and there is tensor.
There is this:
tensor([[[[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
...,
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.]],
[[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
...,
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.]],
[[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
...,
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.]]]])
My network class looks like this:
class Net(nn.Module):
def __init__(self):
super(Net,self).__init__()
self.features=getModel()
def forward(self,x):
print(x)
x=self.features(x)
return x
and in my method getModel() i`m using nn.sequential,