Thanks! It worked.
I don’t know what the problem is. Neural network is not learning.
Could you see again what could be the problem?

Train Epoch: 1 [0/6379 (0%)]	Loss: -0.002382
Test set: Average loss: nan, Accuracy: 400/6379 (6%)
Train Epoch: 2 [0/6379 (0%)]	Loss: nan
Test set: Average loss: nan, Accuracy: 400/6379 (6%)