vision icon indicating copy to clipboard operation
vision copied to clipboard

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

Open programmeddeath1 opened this issue 3 years ago • 4 comments

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!

programmeddeath1 avatar Apr 28 '22 19:04 programmeddeath1

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

MahmudolHasan avatar May 05 '22 06:05 MahmudolHasan

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

programmeddeath1 avatar May 10 '22 06:05 programmeddeath1

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/

hamedty avatar May 31 '22 16:05 hamedty

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

junior0803 avatar Aug 23 '22 01:08 junior0803

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

+1

jginesclavero avatar Feb 10 '23 08:02 jginesclavero

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.

hamedty avatar Feb 10 '23 08:02 hamedty

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

jginesclavero avatar Feb 10 '23 09:02 jginesclavero