I would be careful with the usage of squeeze() without specifying a dimension, since it would remove all dimensions with a size of 1, which might yield unexpected results.
What’s the shape of output and label before you are applying the squeeze() method?
Besides that the code looks alright.