如何高速安装jetson-inference,一步到位,避免踩坑!

踩了很长时间的坑 终于弄明白怎么高速下载jetson inference

来源:安装jetson-inference 自动下载模型,满速下载起飞,解决下载模型被墙问题_奈流云何的博客-CSDN博客

 需要将Github的仓库复制到Gitee上自己的仓库,然后就可以高速下载了

同时参考:Jetson nano 2GB安装tensorRT

sudo apt-get update#检查更新
sudo apt-get install git cmake libpython3-dev python3-numpy#安装必要包
git clone --recursive https://github.com/dusty-nv/jetson-inference#替换成自己的仓库
cd jetson-inference
git submodule update --init#

cd tools/#下面四句 用来替换自己的仓库地址
sed -in-place -e 's@https://nvidia.box.com/shared/static@https://bbs.gpuworld.cn/mirror@g' download-models.sh
sed -in-place -e 's@https://nvidia.box.com/shared/static@https://bbs.gpuworld.cn/mirror@g' install-pytorch.sh
sed -in-place -e 's@https://github.com/pytorch/vision@https://gitee.com/michael-li123/vision@g' install-pytorch.sh
sed -in-place -e 's@https://github.com/dusty-nv/vision@https://gitee.com/michael-li123/vision2@g' install-pytorch.sh


cd ..
mkdir build
cd build
cmake ../

如果Git Submodule update --init出现TLS错误,则测试SSH能够连接到Github,如果不行就需要配置:见解决Github拒绝授权问题Permission denied, please try again_li4692625的博客-CSDN博客

然后修改github子模块的地址(jetson inference根目录),等待更新子模块完成!

vim .gitmodules#jetson root目录
#url修改成[email protected]:....
#保存退出
git submodule sync
git submodule update --init

然后更新完成后执行以下命令,打开如下界面 可以选择自己想要的包! 

#进入jetson inference/build目录 重新编译
cd build
cmake ../

make -j4#build 目录下
sudo make install#build 目录下
sudo ldconfig#build 目录下

编译成功生成以下目录:

如果编译成功,会生成下列文件夹结构

|-build

   aarch64      (64-bit)

      bin   where the sample binaries are built to

      include  where the headers reside

      lib   where the libraries are build to

   armhf           (32-bit)

      bin   where the sample binaries are built to

      include  where the headers reside

      lib   where the libraries are build to

安装opengl按下列命令

sudo apt-get install build-essential

sudo apt-get install build-essential libgl1-mesa-dev

sudo apt-get install libglew-dev libsdl2-dev libsdl2-image-dev libglm-dev libfreetype6-dev

sudo apt-get install libglfw3-dev libglfw3

其他安装包

安装OpenGL Library

sudo apt-get install libgl1-mesa-dev

安装OpenGL Utilities

sudo apt-get install libglu1-mesa-dev
OpenGL Utilities 是一组建构于 OpenGL Library 之上的工具组,提供许多很方便的函数,使 OpenGL 更强大且更容易使用。

安装OpenGL Utility Toolkit

sudo apt-get install libglut-dev

OpenGL Utility Toolkit 是建立在 OpenGL Utilities 上面的工具箱,除了强化了 OpenGL Utilities 的不足之外,也增加了 OpenGL 对于视窗介面支援。
注意:在这一步的时候,可能会出现以下情况,shell提示:

Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package libglut-dev
将上述$ sudo apt-get install libglut-dev命令改成$ sudo apt-get install freeglut3-dev即可

进入测试文件夹,运行

cd jetson-inference/build/aarch64/bin

./imagenet-console ./images/bird_0.jpg output.jpg

猜你喜欢

转载自blog.csdn.net/li4692625/article/details/120303750