pytorch / pytorch/vision

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

Open
#5,919 7 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

topic: binaries
Dominant language
Python
Stars
17.9k
Forks
7.3k
Avg merge
1d 15h
Merged PRs (30d)
13

Description

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!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with torchvision/io/image.py and reproduce the warning using the hosted aarch64 wheels on the reported Python 3.9 and 3.10 environments. Compare loading the image extension and the YOLOv5 model on Raspbian Bullseye and Ubuntu 22.04 with the older working Buster setup. Done means the supported compatibility boundary is identified and the segmentation fault is either reproduced with a narrowed cause or ruled out.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
computer-vision, embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.