官方配置参考:https://github.com/dusty-nv/jetson-inference/blob/master/docs/building-repo-2.md
一、基于TX2的jetson-inference安装:
1.安装依赖
$sudo apt-get install git cmake
2.clone the jetson-inference repo
$ git clone https://github.com/dusty-nv/jetson-inference
$ cd jetson-inference
$ git submodule update --init
3.Configuring with CMake
1.注释掉CMakePreBuild.sh中下载模型、解压模型的带以下关键词的代码,不去下载那些模型文件
#sudo apt-get install -y libopencv-calib3d-dev libopencv-dev
#wget
#mv
#tar -xzvf
2.cmake安装
$ mkdir build
$ cd build
$ cmake ../
##cmake 错误总结##
=========================================================================================
error 1.如果上面cmake出错如下提示(jetson nano开发板不会出现这个问题),则使用下面solve解决方案1的命令行进行cmake:
error1:cmake ../
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find CUDA (missing: CUDA_CUDART_LIBRARY) (found suitable exact
version "9.0")
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.5/Modules/FindCUDA.cmake:949 (find_package_handle_standard_args)
/usr/local/share/OpenCV/OpenCVConfig.cmake:86 (find_package)
/usr/local/share/OpenCV/OpenCVConfig.cmake:105 (find_host_package)
trt-console/CMakeLists.txt:4 (find_package)
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_CUDART_LIBRARY (ADVANCED)
linked by target "jetson-inference" in directory /home/nvidia/jetson-inference
linked by target "imagenet-console" in directory /home/nvidia/jetson-inference/imagenet-console
linked by target "imagenet-camera" in directory /home/nvidia/jetson-inference/imagenet-camera
linked by target "detectnet-console" in directory /home/nvidia/jetson-inference/detectnet-console
linked by target "detectnet-camera" in directory /home/nvidia/jetson-inference/detectnet-camera
linked by target "segnet-console" in directory /home/nvidia/jetson-inference/segnet-console
linked by target "segnet-camera" in directory /home/nvidia/jetson-inference/segnet-camera
linked by target "trt-bench" in directory /home/nvidia/jetson-inference/trt-bench
-- Configuring incomplete, errors occurred!
See also "/home/nvidia/jetson-inference/build/CMakeFiles/CMakeOutput.log".
解决方案1(solve):
$cmake -DCUDA_CUDART_LIBRARY=/usr/local/cuda/lib64/libcudart.so ../
========================================================================================
error 2.不能兼容opencv 4.0.0版本
解决方案2(solve):
修改工程中jetson-inference/tools/trt-console/CMakeLists.txt
改为:find_package(OpenCV 4.0.0 COMPONENTS core calib3d REQUIRED)
========================================================================================
error 3.没有支持python3.5版本的接口
解决方案3(solve):
3.1 修改工程中jetson-inference/python/CMakeLists.txt 第8行
改为:set(PYTHON_BINDING_VERSIONS 3.5 3.6 3.7)
3.2 修改工程中jetson-inference/utils/python/CMakeLists.txt 第8行
set(PYTHON_BINDING_VERSIONS 3.5 3.6 3.7)
========================================================================================
4.Compiling the Project
$ cd jetson-inference/build # omit if pwd is already /build from above
$ make
$ sudo make install