Although sudo pip3 install numpy torch-1.7.0-cp36-cp36m-linux_aarch64.whl has allowed me to sudo python3 setup.py install, it failed with this error:
Building wheel torchvision-0.8.0a0+45f960c
PNG found: False
Running build on conda-build: False
Running build on conda: False
JPEG found: True
Building torchvision with JPEG image support
FFmpeg found: True
ffmpeg include path: /usr/include
ffmpeg library_dir: /usr/lib
running install
running bdist_egg
running egg_info
writing torchvision.egg-info/PKG-INFO
writing dependency_links to torchvision.egg-info/dependency_links.txt
writing requirements to torchvision.egg-info/requires.txt
writing top-level names to torchvision.egg-info/top_level.txt
/usr/local/lib/python3.6/dist-packages/torch/utils/cpp_extension.py:339: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
warnings.warn(msg.format('we could not find ninja.'))
reading manifest file 'torchvision.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '__pycache__' found under directory '*'
warning: no previously-included files matching '*.py[co]' found under directory '*'
writing manifest file 'torchvision.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-aarch64/egg
running install_lib
running build_py
copying torchvision/version.py -> build/lib.linux-aarch64-3.6/torchvision
running build_ext
building 'torchvision.video_reader' extension
aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/aim-1/torchvision/torchvision/csrc/cpu/decoder -I/home/aim-1/torchvision/torchvision/csrc/cpu/video_reader -I/home/aim-1/torchvision/torchvision/csrc/cpu/video -I/usr/include -I/home/aim-1/torchvision/torchvision/csrc -I/usr/local/lib/python3.6/dist-packages/torch/include -I/usr/local/lib/python3.6/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.6/dist-packages/torch/include/TH -I/usr/local/lib/python3.6/dist-packages/torch/include/THC -I/usr/include/python3.6m -c /home/aim-1/torchvision/torchvision/csrc/cpu/video_reader/VideoReader.cpp -o build/temp.linux-aarch64-3.6/home/aim-1/torchvision/torchvision/csrc/cpu/video_reader/VideoReader.o -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=video_reader -D_GLIBCXX_USE_CXX11_ABI=1
In file included from /home/aim-1/torchvision/torchvision/csrc/cpu/decoder/memory_buffer.h:3:0,
from /home/aim-1/torchvision/torchvision/csrc/cpu/video_reader/VideoReader.cpp:6:
/home/aim-1/torchvision/torchvision/csrc/cpu/decoder/defs.h:12:10: fatal error: libavcodec/avcodec.h: No such file or directory
#include <libavcodec/avcodec.h>
^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: command 'aarch64-linux-gnu-gcc' failed with exit status 1
I’m trying to run YOLOv5 on Jetson Nano. When i tried it under Venv with Python v3.6 I managed to install torch and torchvision successfully. But i discovered, that Yolov5 needs Python v3.8. I recreate my Venv and bumped into
ERROR: torch-1.7.0-cp36-cp36m-linux_aarch64.whl is not a supported wheel on this platform.
I manage to download whl with substitution of 38 instead of 36, but result was the same. ERROR: torch-1.7.0-cp38-cp38m-linux_aarch64.whl is not a supported wheel on this platform.
Please, share the know! As i see user student5487 manage to install it with Python v3.9
These wheels were built for Python 3.6, so they won’t work on Python 3.8. You would need to recompile PyTorch wheel against Python 3.8, which I believe is what the other user did.
Hey @dusty_nv ,
I am getting the following error after trying to install torchvision 0.8.1 for Pytorch 1.7.0 on a Jetson AGX Xavier with JetPack 4.4.1 :
FAILED: /home/nvidia/Desktop/torchvision/build/temp.linux-aarch64-3.6/home/nvidia/Desktop/torchvision/torchvision/csrc/cpu/video_reader/VideoReader.o
c++ -MMD -MF /home/nvidia/Desktop/torchvision/build/temp.linux-aarch64-3.6/home/nvidia/Desktop/torchvision/torchvision/csrc/cpu/video_reader/VideoReader.o.d -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/nvidia/Desktop/torchvision/torchvision/csrc/cpu/decoder -I/home/nvidia/Desktop/torchvision/torchvision/csrc/cpu/video_reader -I/home/nvidia/Desktop/torchvision/torchvision/csrc/cpu/video -I/usr/include -I/home/nvidia/Desktop/torchvision/torchvision/csrc -I/home/nvidia/.local/lib/python3.6/site-packages/torch/include -I/home/nvidia/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/nvidia/.local/lib/python3.6/site-packages/torch/include/TH -I/home/nvidia/.local/lib/python3.6/site-packages/torch/include/THC -I/usr/include/python3.6m -c -c /home/nvidia/Desktop/torchvision/torchvision/csrc/cpu/video_reader/VideoReader.cpp -o /home/nvidia/Desktop/torchvision/build/temp.linux-aarch64-3.6/home/nvidia/Desktop/torchvision/torchvision/csrc/cpu/video_reader/VideoReader.o -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=video_reader -D_GLIBCXX_USE_CXX11_ABI=1
In file included from /home/nvidia/Desktop/torchvision/torchvision/csrc/cpu/decoder/memory_buffer.h:3:0,
from /home/nvidia/Desktop/torchvision/torchvision/csrc/cpu/video_reader/VideoReader.cpp:6:
/home/nvidia/Desktop/torchvision/torchvision/csrc/cpu/decoder/defs.h:13:10: fatal error: libavformat/avformat.h: No such file or directory #include <libavformat/avformat.h>
^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File “/home/nvidia/.local/lib/python3.6/site-packages/torch/utils/cpp_extension.py”, line 1522, in _run_ninja_build
env=env)
File “/usr/lib/python3.6/subprocess.py”, line 438, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command ‘[‘ninja’, ‘-v’]’ returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “setup.py”, line 424, in
‘clean’: clean,
…
File “/home/nvidia/.local/lib/python3.6/site-packages/torch/utils/cpp_extension.py”, line 1538, in _run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension
Tried Installing PyTorch v1.7.0
Am able to install PyTorch but while running this command “sudo python3 setup.py install” ti install torchvision, I get the below mentiond error:
from /home/nano/Documents/installer/torchvision/torchvision/csrc/cpu/video_reader/VideoReader.cpp:6:
/home/nano/Documents/installer/torchvision/torchvision/csrc/cpu/decoder/defs.h:12:10: fatal error: libavcodec/avcodec.h: No such file or directory
#include <libavcodec/avcodec.h>
^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: command 'aarch64-linux-gnu-gcc' failed with exit status 1
Kindly suggest the solution. I’m using Jetson nano, python3.6 (used JetPack 4.4.1).
And the final output after trying to install torchvision is (error output):
from /home/nano/Documents/installer/torchvision/torchvision/csrc/cpu/video_reader/VideoReader.cpp:6:
/home/nano/Documents/installer/torchvision/torchvision/csrc/cpu/decoder/defs.h:13:10: fatal error: libavformat/avformat.h: No such file or directory include <libavformat/avformat.h>
^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: command ‘aarch64-linux-gnu-gcc’ failed with exit status 1
I’ve not specifically installed “ffmpeg”. “ffmpeg -version” gives the following output:
Resolved issue, reinstalled libavformat and libswscale with following command before executing the above command: sudo apt-get install --reinstall libavformat-dev libswscale-dev
Thanks @vinayrraj and @david_1 - I have updated the install instructions with these packages. It seems like ffmpeg executable is not installed by default, but the libraries that torchvision wants to use are not.
You would first need to compile/install MAGMA, and then re-build PyTorch by following the Build from Source instructions in the first post of this topic.
However, what may be easier is to just change that line of code to the following so it doesn’t try to use MAGMA:
return torch.solve(B.cpu(), A.cpu())[0] # you may also need [0].cuda() - I'm not sure