Maybe you still want the pooling?
And given the error, I guess your view op is not correct. And the -1 does not match the batch size because the other value does not match the dimensions.
You can add prints in your forward pass just before the view to check the size of x. And make sure the second dimension is what you expect. Or do:
# Assuming 4D x as it comes out of the 2d Convolutions above.
x = x.view(x.size(0), x.size(1) * x.size(2) * x.size(3))