mailcorahul:

You should ideally provide the image in the order (H, W, C to PIL for resizing(and not as <C, H, W> as you have provided above, hence the error). You can later transpose the tensor to get the shape = (N, C, H, W).


These different representations of different programs are so fucking annoying and can cause unnecessary headaches.