Hi @Push
Seems like this issue has nothing related to PyTorch.
But at a glance I see that PIL is complaining about wrong data type. It works with 2d or 3d arrays, where the number of channels comes in the last position and should be within 2,3 or 4.