Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MMDeploy exported models on Nvidia Jetson devices #122

Closed
RS00001 opened this issue Jan 29, 2022 · 17 comments
Closed

MMDeploy exported models on Nvidia Jetson devices #122

RS00001 opened this issue Jan 29, 2022 · 17 comments
Assignees

Comments

@RS00001
Copy link

RS00001 commented Jan 29, 2022

MMDeploy looks good and I had a few questions relating to deploying the output model on Nvidia EDGE device that I could not find on Readthedocs and Github pages. Apologies in advance if the questions are very basic in nature:

  1. For Nvidia deployment, we will be selecting the TensorRT deployment option. So once I convert the model and get the SDK using my Mac, will I still need to install PyTorch on the Nvidia device that I want to use for inference? In other words, My Nvidia Device has the JetPack already installed, which includes TensorRT. So, can I simply 1) run the converted model, 2) need SDK with the converted model or 3) Need SDK, converted model and PyTorch + other installations suggested by MMPose?

  2. I intend to use the model for pose detection using MMPose. Will there be any additional dependencies?

Update: I am planning to install the MMDeploy on my Mac and then get the updated model and SDK for my inference device which is Nvidia

@RunningLeon
Copy link
Collaborator

RunningLeon commented Jan 29, 2022

@RS00001 Hi, you could refer to the tutorial how_to_install_mmdeploy_on_jetsons.md for the jetson device. BTW, current we have not supported any mmpose model in mmdeploy yet. But it will come soon.

@RunningLeon RunningLeon self-assigned this Jan 29, 2022
@RS00001
Copy link
Author

RS00001 commented Jan 29, 2022

@RunningLeon Thank you for the help. If you don't mind, could you please clarify this for me... My intention is to generate the model and the SDK using my Mac and then get these deployed artifacts onto my Jetson Nano. So, above installation tutorial, is it for the device where I run inference or for the (Mac) device where I generate the SDK and my final model for TensorRT deployment?

Also, the device where i run inference, will I still need to install the PyTorch? I am assuming that because we are converting this model for TensorRT, there will be no need to install the PyTorch to run inference. Is that correct?

@RunningLeon
Copy link
Collaborator

@RunningLeon Thank you for the help. If you don't mind, could you please clarify this for me... My intention is to generate the model and the SDK using my Mac and then get these deployed artifacts onto my Jetson Nano. So, above installation tutorial, is it for the device where I run inference or for the (Mac) device where I generate the SDK and my final model for TensorRT deployment?

@RS00001 Hi, how_to_install_mmdeploy_on_jetsons.md is for installing mmdeploy on Jetson Nano device. Once you have mmdeploy installed, you could do the conversion from PyTorch model to ONNX and then to TensorRT engine. With TensorRT engine, you can do the deployment.
Since you have to create TensorRT engine on your Jetson Nano device, you may have to install PyTorch as goes by the tutorial.
Once you have your TensorRT engine created, you can uninstall PyTorch and run inference for sure.

@RS00001
Copy link
Author

RS00001 commented Feb 1, 2022

Thanks @RunningLeon

@RS00001
Copy link
Author

RS00001 commented Feb 1, 2022

I followed the instructions and have spent whole day today trying to install the MMDEploy which includes installing MMCV. I tried both, installing from source and also the pre-compiled packages. In both, it is stuck at the stage "Building setup.py..." and even after hours there is no result. Could you please help

@tehkillerbee
Copy link
Contributor

tehkillerbee commented Feb 1, 2022

@RS00001 Some workarounds might be necessary necessary due to an old python 3.6 version. It sounds like you are running into similar issues as I did. Which package does it get stuck at building?

Maybe first run the following tool and list the versions of your OS and installed packages

https://github.com/jetsonhacks/jetsonUtilities

In (very) broad terms, I did the following (Some of these steps might not be relevant to you). Also, the below steps is still very much a WIP. Maybe they can be useful for mmdeploy documentation.

  • Make sure to update pip, setuptools, wheel, protobuf before installing remaining dependencies. Something along the following lines:
# dependencies
sudo apt-get purge cmake
sudo apt-get install curl ninja-build -y
sudo apt-get install python3-venv python3-dev python3-setuptools -y
curl https://bootstrap.pypa.io/pip/3.6/get-pip.py -o get-pip.py
sudo python3 get-pip.py
pip3 install testresources
pip3 install --upgrade setuptools wheel
sudo snap install cmake --classic
  • If using virtual environment (Thats what I did), make sure to create it to inherit system-site-packages, otherwise tensorrt python package will be missing.
  • Install older numpy (otherwise your torch probably wont work and will result in segfault when importing pytorch)
  • Update protobuf (jetson comes with old version)
python3 -m venv venv-mmdet --system-site-packages
.. (Install all relevant dependencies in venv, including pip, setuptools, wheel.)
pip3 install testresources
pip3 install --upgrade setuptools wheel
# protofbuf on jetson is quite old - must be upgraded
pip3 install --upgrade protobuf
# update misc python packages
pip3 install numpy==1.19.4
pip3 install opencv-python
pip3 install matplotlib
  • Install Pytorch 1.10 (use package from nvidia)
# pytorch
wget https://nvidia.box.com/shared/static/fjtbno0vpo676a25cgvuqc1wty0fkkg6.whl -O torch-1.10.0-cp36-cp36m-linux_aarch64.whl
pip3 install torch-1.10.0-cp36-cp36m-linux_aarch64.whl
  • Torchvision, build from sources. Pick version suitable for your pytorch (for pytorch 1.10.0, use 0.11.1)
# torchvision 
sudo apt-get install libjpeg-dev zlib1g-dev libpython3-dev libavcodec-dev libavformat-dev libswscale-dev
sudo rm -r torchvision
git clone --branch v0.11.1 https://github.com/pytorch/vision torchvision
cd torchvision
export BUILD_VERSION=0.11.1  # where 0.x.0 is the torchvision version  
python3 setup.py install
cd ../
  • Install mmcv
# mmcv
pip3 uninstall mmcv-full
pip3 install mmcv-full==1.4.1 -f https://download.openmmlab.com/mmcv/dist/cu102/torch1.10.0/index.html
  • Setup mmdeploy + dependencies
# mmdeploy + dependencies (OpenCV is assumed to be installed!)
sudo apt-get install libspdlog-dev -y
# misc mmdeploy/h5py dependencies (maybe not needed when installing using pip
sudo apt-get install libhdf5-dev -y
  • ppl_cv
cd ${PROJECT_DIR}/ppl.cv
rm -r cuda-build
./build.sh cuda
  • h5py
## h5py not directly supported by jetson and must be built/installed manually
# as a workaround, we will install an earlier version that can build and install successfully
pip3 install h5py==2.9.0
# maybe do the following instead?
#sudo apt-get install pkd-config libhdf5-100 libhdf5-dev
#pip install versioned-hdf5 --no-cache-dir
  • mmdeploy + SDK
cd ${PROJECT_DIR}/MMDeploy
git submodule update --init --recursive
pip install -e .
rm -r build
mkdir build -p && cd build
cmake .. \
  -DMMDEPLOY_BUILD_SDK=ON \
  -DCMAKE_CXX_COMPILER=g++ \
  -Dpplcv_DIR=${PROJECT_DIR}/ppl.cv/cuda-build/install/lib/cmake/ppl \
  -DMMDEPLOY_TARGET_DEVICES="cuda;cpu" \
  -DMMDEPLOY_TARGET_BACKENDS=trt \
  -DMMDEPLOY_CODEBASES=all
cmake --build . -- -j$(nproc) && cmake --install .
sudo ldconfig
  • add MMDeploy_DIR to bashrc
echo -e 'export MMDeploy_DIR='${PROJECT_DIR}'/MMDeploy/build/install/lib/cmake/MMDeploy' >> ${HOME}/.bashrc
source ${HOME}/.bashrc
  • mmdeploy examples
export LD_LIBRARY_PATH=${PROJECT_DIR}/MMDeploy/build/install/lib
cd ${PROJECT_DIR}/MMDeploy/build/install/example
rm -r build
mkdir build -p && cd build
cmake -DMMDeploy_DIR=${PROJECT_DIR}/MMDeploy/build/install/lib/cmake/MMDeploy ..
make all

@RS00001
Copy link
Author

RS00001 commented Feb 1, 2022

@tehkillerbee big thank you! for the detailed steps. I will give it a go. Btw, I think you mentioned in the initial comment that the inference performance with TensorRT may not match that of PyTorch even on AGX. We are planning to deploy on Nano or may be Xavier NX which are smaller devices. Any suggestion on improving the inference performance on those?

Also, if we find a way to build higher version of Torch and TorchVision along with Python 3.8, will that help? The reason we are going with Torch 1.10 is that that's the highest version I found on the Nvidia forum here: https://forums.developer.nvidia.com/t/pytorch-for-jetson-version-1-10-now-available/72048

@tehkillerbee
Copy link
Contributor

tehkillerbee commented Feb 1, 2022

@RS00001 Well, the TensorRT backend is much faster than Pytorch on both my PC and Jetson AGX.

The detections themselves appear different, distorted somewhat and the boundary boxes are also shifted slightly. I have created an issue #127 . Maybe a bug in mmdeploy? It could also be an incompatibility with the version of TensorRT7 bundled with the old Jetpack 4.5I am using so I will try to upgrade to Jetpack 4.6 asap

I never experienced this issue when deploying TensorRT using mmdetection-to-tensorrt by @grimoire.

@RS00001
Copy link
Author

RS00001 commented Feb 2, 2022

@tehkillerbee - got it, thanks. Btw, were you able to install it on your AGX with a higher Python and Pytorch version?

@tehkillerbee
Copy link
Contributor

@RS00001 Sure, I used the latest(?) Pytorch 1.10.0 listed by Nvidia. I also used the latest mmdeploy, although with some modifications to build with TensorRT7.

@RS00001
Copy link
Author

RS00001 commented Feb 2, 2022

@tehkillerbee - did that work with python 3.7 or later?

@tehkillerbee
Copy link
Contributor

@RS00001 I have only tested with 3.6

@RS00001
Copy link
Author

RS00001 commented Feb 2, 2022

@tehkillerbee - I am also trying with 3.6 and with the steps you provided. However, I am getting stuck at Torchvision installation. It is failing with a runtime error.

Let me know if you encountered anything like this......

(mmdeploy2) nano4g@nano4g-desktop:~/torchvision$ python3 setup.py install --user
/home/nano4g/mmdeploy2/lib/python3.6/site-packages/pkg_resources/init.py:119: PkgResourcesDeprecationWarning: 0.18ubuntu0.18.04.1 is an invalid version and will not be supported in a future release
PkgResourcesDeprecationWarning,
Building wheel torchvision-0.11.1
PNG found: False
Running build on conda-build: False
Running build on conda: True
JPEG found: True
Building torchvision with JPEG image support
NVJPEG found: False
FFmpeg found: True
ffmpeg include path: ['/usr/include', '/usr/include/aarch64-linux-gnu']
ffmpeg library_dir: ['/usr/lib', '/usr/lib/aarch64-linux-gnu']
running install
/home/nano4g/mmdeploy2/lib/python3.6/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
setuptools.SetuptoolsDeprecationWarning,
/home/nano4g/mmdeploy2/lib/python3.6/site-packages/setuptools/command/easy_install.py:159: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
EasyInstallDeprecationWarning,
/home/nano4g/mmdeploy2/lib/python3.6/site-packages/pkg_resources/init.py:119: PkgResourcesDeprecationWarning: 0.18ubuntu0.18.04.1 is an invalid version and will not be supported in a future release
PkgResourcesDeprecationWarning,
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
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 '*'
adding license file 'LICENSE'
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.C' extension
Emitting ninja build file /home/nano4g/torchvision/build/temp.linux-aarch64-3.6/build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
[1/12] /usr/local/cuda/bin/nvcc -DWITH_CUDA -I/home/nano4g/torchvision/torchvision/csrc -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include/TH -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/nano4g/mmdeploy2/include -I/usr/include/python3.6m -c -c /home/nano4g/torchvision/torchvision/csrc/ops/cuda/deform_conv2d_kernel.cu -o /home/nano4g/torchvision/build/temp.linux-aarch64-3.6/home/nano4g/torchvision/torchvision/csrc/ops/cuda/deform_conv2d_kernel.o -D__CUDA_NO_HALF_OPERATORS
_ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="gcc"' '-DPYBIND11_STDLIB="libstdcpp"' '-DPYBIND11_BUILD_ABI="cxxabi1011"' -DTORCH_EXTENSION_NAME=C -D_GLIBCXX_USE_CXX11_ABI=1 -gencode=arch=compute_53,code=compute_53 -gencode=arch=compute_53,code=sm_53 -std=c++14
FAILED: /home/nano4g/torchvision/build/temp.linux-aarch64-3.6/home/nano4g/torchvision/torchvision/csrc/ops/cuda/deform_conv2d_kernel.o
/usr/local/cuda/bin/nvcc -DWITH_CUDA -I/home/nano4g/torchvision/torchvision/csrc -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include/TH -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/nano4g/mmdeploy2/include -I/usr/include/python3.6m -c -c /home/nano4g/torchvision/torchvision/csrc/ops/cuda/deform_conv2d_kernel.cu -o /home/nano4g/torchvision/build/temp.linux-aarch64-3.6/home/nano4g/torchvision/torchvision/csrc/ops/cuda/deform_conv2d_kernel.o -D__CUDA_NO_HALF_OPERATORS
-D__CUDA_NO_HALF_CONVERSIONS
-D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -gencode=arch=compute_53,code=compute_53 -gencode=arch=compute_53,code=sm_53 -std=c++14
Killed
[2/12] c++ -MMD -MF /home/nano4g/torchvision/build/temp.linux-aarch64-3.6/home/nano4g/torchvision/torchvision/csrc/ops/nms.o.d -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DWITH_CUDA -I/home/nano4g/torchvision/torchvision/csrc -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include/TH -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/nano4g/mmdeploy2/include -I/usr/include/python3.6m -c -c /home/nano4g/torchvision/torchvision/csrc/ops/nms.cpp -o /home/nano4g/torchvision/build/temp.linux-aarch64-3.6/home/nano4g/torchvision/torchvision/csrc/ops/nms.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++14
[3/12] c++ -MMD -MF /home/nano4g/torchvision/build/temp.linux-aarch64-3.6/home/nano4g/torchvision/torchvision/csrc/ops/ps_roi_align.o.d -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DWITH_CUDA -I/home/nano4g/torchvision/torchvision/csrc -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include/TH -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/nano4g/mmdeploy2/include -I/usr/include/python3.6m -c -c /home/nano4g/torchvision/torchvision/csrc/ops/ps_roi_align.cpp -o /home/nano4g/torchvision/build/temp.linux-aarch64-3.6/home/nano4g/torchvision/torchvision/csrc/ops/ps_roi_align.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++14
[4/12] c++ -MMD -MF /home/nano4g/torchvision/build/temp.linux-aarch64-3.6/home/nano4g/torchvision/torchvision/csrc/ops/deform_conv2d.o.d -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DWITH_CUDA -I/home/nano4g/torchvision/torchvision/csrc -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include/TH -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/nano4g/mmdeploy2/include -I/usr/include/python3.6m -c -c /home/nano4g/torchvision/torchvision/csrc/ops/deform_conv2d.cpp -o /home/nano4g/torchvision/build/temp.linux-aarch64-3.6/home/nano4g/torchvision/torchvision/csrc/ops/deform_conv2d.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="gcc"' '-DPYBIND11_STDLIB="libstdcpp"' '-DPYBIND11_BUILD_ABI="cxxabi1011"' -DTORCH_EXTENSION_NAME=C -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++14
[5/12] c++ -MMD -MF /home/nano4g/torchvision/build/temp.linux-aarch64-3.6/home/nano4g/torchvision/torchvision/csrc/ops/interpolate_aa.o.d -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DWITH_CUDA -I/home/nano4g/torchvision/torchvision/csrc -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include/TH -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/nano4g/mmdeploy2/include -I/usr/include/python3.6m -c -c /home/nano4g/torchvision/torchvision/csrc/ops/interpolate_aa.cpp -o /home/nano4g/torchvision/build/temp.linux-aarch64-3.6/home/nano4g/torchvision/torchvision/csrc/ops/interpolate_aa.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="gcc"' '-DPYBIND11_STDLIB="libstdcpp"' '-DPYBIND11_BUILD_ABI="cxxabi1011"' -DTORCH_EXTENSION_NAME=C -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++14
[6/12] /usr/local/cuda/bin/nvcc -DWITH_CUDA -I/home/nano4g/torchvision/torchvision/csrc -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include/TH -I/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/nano4g/mmdeploy2/include -I/usr/include/python3.6m -c -c /home/nano4g/torchvision/torchvision/csrc/ops/cuda/roi_pool_kernel.cu -o /home/nano4g/torchvision/build/temp.linux-aarch64-3.6/home/nano4g/torchvision/torchvision/csrc/ops/cuda/roi_pool_kernel.o -D__CUDA_NO_HALF_OPERATORS
-D__CUDA_NO_HALF_CONVERSIONS
-D__CUDA_NO_BFLOAT16_CONVERSIONS
-D__CUDA_NO_HALF2_OPERATORS
--expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -gencode=arch=compute_53,code=compute_53 -gencode=arch=compute_53,code=sm_53 -std=c++14
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "/home/nano4g/mmdeploy2/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:

Traceback (most recent call last):
File "setup.py", line 508, in
'clean': clean,
File "/home/nano4g/mmdeploy2/lib/python3.6/site-packages/setuptools/init.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/nano4g/mmdeploy2/lib/python3.6/site-packages/setuptools/command/install.py", line 74, in run
self.do_egg_install()
File "/home/nano4g/mmdeploy2/lib/python3.6/site-packages/setuptools/command/install.py", line 116, in do_egg_install
self.run_command('bdist_egg')
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/nano4g/mmdeploy2/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 164, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "/home/nano4g/mmdeploy2/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 150, in call_command
self.run_command(cmdname)
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/nano4g/mmdeploy2/lib/python3.6/site-packages/setuptools/command/install_lib.py", line 11, in run
self.build()
File "/usr/lib/python3.6/distutils/command/install_lib.py", line 109, in build
self.run_command('build_ext')
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/nano4g/mmdeploy2/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 79, in run
_build_ext.run(self)
File "/home/nano4g/mmdeploy2/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "/usr/lib/python3.6/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 735, in build_extensions
build_ext.build_extensions(self)
File "/home/nano4g/mmdeploy2/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions
_build_ext.build_ext.build_extensions(self)
File "/usr/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "/usr/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "/home/nano4g/mmdeploy2/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 202, in build_extension
_build_ext.build_extension(self, ext)
File "/usr/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension
depends=ext.depends)
File "/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 565, in unix_wrap_ninja_compile
with_cuda=with_cuda)
File "/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1404, in _write_ninja_file_and_compile_objects
error_prefix='Error compiling objects for extension')
File "/home/nano4g/mmdeploy2/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1733, in _run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension

@tehkillerbee
Copy link
Contributor

tehkillerbee commented Feb 7, 2022

@RS00001 It looks like you are running out of RAM and the build process was killed. I guess that makes sense since you are using a jetson nano 4G, whereas I'm using either 8 or 32GB platforms. Try increasing your swap and see if it helps.

@RS00001
Copy link
Author

RS00001 commented Feb 7, 2022

@tehkillerbee thank you! I tried with the Xavier Nx which is 8gb RAM and it worked. The steps you provided earlier were super useful. Did MMDeploy work for you for MMPOSE models? It works for MM Detection but I am yet to test it with MMPOSE. Please let me know if you had any success with that.

@tehkillerbee
Copy link
Contributor

@RS00001 Great to hear! I have not tried mmpose models myself, so I cannot give any advice there.

@RunningLeon
Copy link
Collaborator

Closed due to age.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants