output seems to have a single dimension, which seems to be wrong.
Did you delete the batch dimension?
If not, could you print(output.shape) in your code before trying to compute the predictions?
For a multi-class classification, the output should have the shape [batch_size, nb_classes].
Check if you code for all squeeze() calls, which might have removed the batch dimension of 1.