TX2入门教程软件篇-安装jetson-inference
TX2入门教程软件篇-安装jetson-inference
说明:
- 介绍如何在tx2安装安装jetson-inference
- 测试环境:jetpack33
步骤:
- 安装依赖
# git and cmake should be installed
sudo apt-get install git cmake
- 下载jetson-inference库
cd ~/workspace
git clone -b L4T-R28.2 https://github.com/dusty-nv/jetson-inference
cd jetson-inference
git submodule update --init
- 编译jetson-inference
- 新建build目录
mkdir build
cd build
- 编译
cmake -DCUDA_CUDART_LIBRARY=/usr/local/cuda/lib64/libcudart.so ../
- 需要选择是否下载模型,如果单独下载选择quit,要不时间很长。
- 需要选择是否安装pytorch,如果单独安装,选择quit
- 增加python3.5支持
- 修改jetson-inference/python/CMakeLists.txt
- 增加3.5
set(PYTHON_BINDING_VERSIONS 2.7 3.5 3.6 3.7)
- 修改jetson-inference/utils/python/CMakeLists.txt
- 增加3.5
set(PYTHON_BINDING_VERSIONS 2.7 3.5 3.6 3.7)
安装jetson-inference
make
sudo make install
- 单独下载模型
$ cd jetson-inference/tools
$ ./download-models.sh
- 下载模型解压到jetson-inference/data/networks目录下
- 单独安装Pytorch
$ cd jetson-inference/build
$ ./install-pytorch.sh
测试:
- 识别静态图:
$ cd jetson-inference/build/aarch64/bin
- 识别橙子
$ ./imagenet-console orange_0.jpg output_0.jpg
- 首次运行速度比较慢,第二次运行速度将加快
- 效果:
- 识别苹果
$ ./imagenet-console granny_smith_1.jpg output_1.jpg
- 效果:
参考:
- https://github.com/dusty-nv/jetson-inference/blob/master/docs/building-repo-2.md
- https://github.com/dusty-nv/jetson-inference
- https://github.com/dusty-nv/jetson-inference/blob/master/docs/detectnet-console-2.md
- https://github.com/dusty-nv/jetson-inference/blob/master/docs/imagenet-console-2.md
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号