pytorch / vision

Datasets, Transforms and Models specific to Computer Vision
https://pytorch.org/vision
BSD 3-Clause "New" or "Revised" License
16.13k stars 6.94k forks source link

Failed to load image python extension/Segmentation fault in Raspberry pi 4B with python 3.9/10 #5919

Open programmeddeath1 opened 2 years ago

programmeddeath1 commented 2 years ago

On installing the raspberry pi (aarch64) hosted wheels on both the raspbian os(bullseye) with python 3.9, and ubuntu 22.04 with python 3.10. on loading torch vision I get a user warning :

python3.10/site-packages/torchvision/io/image.py:11 UserWarning: Failed to load Image Python extension: warn("Failed to load image python extension: {e}")

On running the yolov5 detection, after loading the model, the program exits with segmentation fault in ubuntu. On the raspbian os, it runs for sometime but on pressing anything on the keyboard the program ends with segmentation fault (core dumped)

This is weird because my yolov5 detection applications were running on raspbian os older version(buster os) which by default has python 3.7 with even the pytorch 1.11.0 and vision 0.12.0 wheels installed directly from hosted using pip install torch torchvision. Since both ubuntu and new raspbian os have 3.10 and 3.9 by default, i installed all dependencies. Since the only difference in both y test scenarios are the python versions I believe this could be a hosted wheel issue or a deeper python version issue I am unaware of.

Thanks for any help in advance!

MahmudolHasan commented 2 years ago

Did you solve this issue? I am facing the same problem.

programmeddeath1 commented 2 years ago

For now I just reverted to buster OS with the latest torch 1.11.0. Since i urgently needed to get it to work.

hamedty commented 2 years ago

it started on torchvision==0.11.0. 0.10.0 looks good.

pip uninstall torchvision

pip install torchvision==0.10.0 -f https://download.pytorch.org/whl/torchvision/

junior0803 commented 2 years ago

For now, I am facing the same problem on Ubuntu 20.04, os has python 3.8 version

jginesclavero commented 1 year ago

For now, I am facing the same problem on Ubuntu 20.04, os has python 3.8 version

+1

hamedty commented 1 year ago

In my case it turned out I had installed the 32bit OS on the 64bit cpu. Just make sure you are loading a 64bit version of the OS and from there you can install everything normally.

jginesclavero commented 1 year ago

I'm working in a Jetson ORIN and I have no choice, I have to install manylinux2014_aarch64 version...