You are not flattening the activation output of self.conv4 before feeding it to self.fc1, so add
x = F.relu(x)
x = x.view(x.size(0), -1)
x = F.relu(self.fc1(x))

to avoid this error.
Also, F.nll_loss expects log probabilities, so use F.log_softmax instead of F.softmax.