subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1

I am trying to instal torchvision on my jetson nano with this commands:

sudo apt install -y libjpeg-dev zlib1g-dev
git clone --branch v0.11.1 GitHub - pytorch/vision: Datasets, Transforms and Models specific to Computer Vision torchvision
cd torchvision
sudo python3 setup.py install

but i get this error message and dont know how to solve it.:

ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File “/home/demagcranes/.local/lib/python3.6/site-packages/torch/utils/cpp_extension.py”, line 1723, 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:

Hi,

Just try the installation on JetPack 4.6.3 and it can work correctly.
Please give it a try.

$ sudo apt-get install libjpeg-dev zlib1g-dev libpython3-dev libavcodec-dev libavformat-dev libswscale-dev
$ git clone --branch v0.11.1 https://github.com/pytorch/vision torchvision
$ cd torchvision/
$ export BUILD_VERSION=0.11.1
$ python3 setup.py install --user
...
Searching for dataclasses==0.8
Best match: dataclasses 0.8
Adding dataclasses 0.8 to easy-install.pth file

Using /home/nvidia/.local/lib/python3.6/site-packages
Finished processing dependencies for torchvision==0.11.1

Thanks.

i tried it on jetpack 4.6.3 but i get the same result.

cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
c++: internal compiler error: Killed (program cc1plus)
.
.
.
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File “/home/demagcranes/.local/lib/python3.6/site-packages/torch/utils/cpp_extension.py”, line 1723, in _run_ninja_build
env=env)
File “/home/demagcranes/.conda/envs/pytorch1/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:

Hi @muharrem.akdemir, the Killed message typically means that your board ran out of memory (you can use tegrastats to monitor the memory usage).

To make more memory available, you could try mounting swap and/or disabling the desktop GUI:
https://github.com/dusty-nv/jetson-inference/blob/master/docs/pytorch-transfer-learning.md#mounting-swap

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.