I expect, your problem is when using view         x = x.view(x.size(0), 3 * 224 * 224) which is giving error,
without  providing explicit shape it might be better to use
x.view(x.shape[0],-1)
Another problem might be in self.fc1 and self.fc2
As we know,  torch.nn.Linear(in_features, out_features)
so you need to change,
fc1 : in_features to be shape of self.conv2 returning shape, in my case if input is 224x224 then
and also out_features should be input of fc2 as in example,
self.fc1 = nn.Linear(46656, 144)  # 6*6 from image dimension
self.fc2 = nn.Linear(144, 84)

Hope it solves problem