I was training a YOLOv8 object detection model on my jetson orin nano, and after the first epoch I got the following error message:
AttributeError: partially initialized module ‘torchvision’ has no attribute ‘extension’ (most likely due to a circular import)
I realized my torchvision version was 0.19.0 which is not correct for my torch version which is torch-2.3.0a0+ebedce2. I tried installing 0.18.0 through pip but that uninstalled my torch version and reinstalled torch 2.3.0 without CUDA enabled. Which torchvision version is compatible with torch-2.3.0a0+ebedce2 and how can I install it?
Additionally, I tried using the installation instructions for torchvision from this link (PyTorch for Jetson) but got the following error:
In file included from /home/anaygokhale/torchvision/torchvision/csrc/io/image/cpu/decode_jpeg.cpp:3:
/home/anaygokhale/torchvision/torchvision/csrc/io/image/cpu/exif.h:221:39: error: ‘png_structp’ was not declared in this scope
221 | inline int fetch_png_exif_orientation(png_structp png_ptr, png_infop info_ptr) {
| ^~~~~~~~~~~
/home/anaygokhale/torchvision/torchvision/csrc/io/image/cpu/exif.h:221:60: error: ‘png_infop’ was not declared in this scope
221 | inline int fetch_png_exif_orientation(png_structp png_ptr, png_infop info_ptr) {
| ^~~~~~~~~
/home/anaygokhale/torchvision/torchvision/csrc/io/image/cpu/exif.h:221:78: error: expression list treated as compound expression in initializer [-fpermissive]
221 | inline int fetch_png_exif_orientation(png_structp png_ptr, png_infop info_ptr) {
| ^
error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1
@nagesh_accord But the “Build from Source” section only mentions torch, not torchvision. I tried the torchvision method that is listed under the “Installation” section and that gave me the error that I mentioned in my original post.
@AastaLLL As I mentioned in both my previous messages, Those commands did not work for me. I have put the error message in my initial post. Please help me with that issue
Hello,
What would the correct command be for the installation of the torchvision and torchaudio using the above packages?
The torchvision installation instructions gave me an error as mentioned previously.