transforms.RandomCrop()

Hello,

I want to RandomCrop the numpy array but facing the error.
Each input is shaped (channel=10, h=800, w=1200) and trying to transform in the custom dataset class.

the error message says,

TypeError: cannot unpack non-iterable builtin_function_or_method object

Does this happen because input wasn’t PIL image?
If so, can someone share the way to transform numpy array.

Thank you

Hi @yuyaya,

A way to do would be to transform your numpy array to PIL Image in order to apply the transformation.

You can refer to this post Image data augmentation for numpy data