Then your linear layer should have in_features=64*9*9. Otherwise you will mix your features into the batch dimension, which yields your current error.
Could you change self.fc1 = nn.Linear(64*9*9, 1024) and also use my code to reshape the tensor?