Hello @Alexandra_Lorenzo
That error looks very uninformative, I think this is because of quite old version used (# PyTorch v0.4.0).
What I can see from you code that Linear takes output from Conv2d without any modifications.
...
x = self.conv7(x)
print('size',x.size())
x = self.fc1(x)
...

This is definitely cause shape mismatch error. Linear takes 3d input, while Conv2d outputs 4d tensors. Please consider using poolings or flatening before dense layer