7029279:

Should my torch max and min values have integer values, instead of float?


Yes, the target should be a LongTensor. The min values should be 0, while the max value should be nb_classes-1.



 7029279:

Also, you are using cmap in matplolib instead of PIL, is using PIL not reccomended?


No, use whatever works for you. I’m probably more familiar with the matplotlib color map than with PIL, but don’t have any recommendations.