Add print statements to show the shape of each activation before feeding it into a linear layer in the forward function via:
x = ...
print(x.shape)
x = self.fc(x)

This would tell you which activation is causing this error and if a reshaping is done in a wrong way or if the in_features of the linear are set to a wrong value.