hityzy1122 / opencv_transforms_torchvision

opencv reimplement for transforms in torchvision
MIT License
193 stars 29 forks source link

TypeError: img should be CV Image. Got <class 'PIL.Image.Image'> #5

Open Sudhakar17 opened 5 years ago

Sudhakar17 commented 5 years ago

I am using data loader from pytorch and data transform using your code. I am getting this error, "TypeError: img should be CV Image. Got <class 'PIL.Image.Image'>"

How to feed cvImage instead of PIL image to the model? Is there any other way?

Pytorch Version : 1.1 Windows 10

hityzy1122 commented 5 years ago

I am using data loader from pytorch and data transform using your code. I am getting this error, "TypeError: img should be CV Image. Got <class 'PIL.Image.Image'>"

How to feed cvImage instead of PIL image to the model? Is there any other way?

Pytorch Version : 1.1 Windows 10

The image should be loaded by cv2.imread(), or converted to a numpy array if loaded by PIL