Thanks Chen, I found this yesterday, used defaultdict(LabelEncoder) and updated the Notebooke: https://github.com/QuantScientist/Deep-Learning-Boot-Camp/blob/master/day%2002%20PyTORCH%20and%20PyCUDA/PyTorch/21-PyTorch-CIFAR-10-Custom-data-loader-from-scratch.ipynb 108
I was surprised since PyTorch can work with class labels which are not encoded, but when you write a Custom dataset it actually forces you to do so (e.g. encode)