Faster-rcnn.pytorch: Pillow multiple version requirements in Pytorch-1.0?

Created on 30 May 2019  路  4Comments  路  Source: jwyang/faster-rcnn.pytorch

Torchvision, used here, requires Pillow>=4.1.1.

However, demo.py uses scipy.misc.imread, which relies on Pillow functionality that only appears seemingly if you go as far back as Pillow version 2.

I've been unable to satisfy both requirements at the same time. Is there a workaround? Or maybe this code should be re-written to use cv2 instead of scipy.misc.imread, to avoid the dependency on an old Pillow.

Most helpful comment

Hi,
I encountered the similar error with you guys, and I modified the code of "demo.py" and "minibatch.py"(under the directory /faster-rcnn.pytorch/lib/roi_data_layer/).
I replaced "scipy.misc" with "imageio" since imread is deprecated in SciPy 1.0.0 and removed in SciPy 1.2.0
This solved my problem. Hope it will help you too.

All 4 comments

+1

Hi,
I encountered the similar error with you guys, and I modified the code of "demo.py" and "minibatch.py"(under the directory /faster-rcnn.pytorch/lib/roi_data_layer/).
I replaced "scipy.misc" with "imageio" since imread is deprecated in SciPy 1.0.0 and removed in SciPy 1.2.0
This solved my problem. Hope it will help you too.

@ensenginbaieer feel free to submit a PR

i ended up having to switch to openCV and uncomment the line which was already there using it

Hi,
I encountered the similar error with you guys, and I modified the code of "demo.py" and "minibatch.py"(under the directory /faster-rcnn.pytorch/lib/roi_data_layer/).
I replaced "scipy.misc" with "imageio" since imread is deprecated in SciPy 1.0.0 and removed in SciPy 1.2.0
This solved my problem. Hope it will help you too.

you can also pip install scipy==1.1.0 and the imread function still is there

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EmmaSRH picture EmmaSRH  路  4Comments

ZhangJiajun1995 picture ZhangJiajun1995  路  5Comments

gullalc picture gullalc  路  4Comments

hiroponnn picture hiroponnn  路  4Comments

gayathrimahalingam picture gayathrimahalingam  路  3Comments