I moved the GPU loading methods from my Dataset class to the train method but nothing changed.
This is how train_loader is made :

capture3.png775×43 6.92 KB

Note that when I try to increase batch size from 1 to 2 or more I got this error (maybe it can help to find the problem) :

capture2.png1010×65 8.19 KB

The error happens at the beginning of the first convolutionnal layer …