跟领导吹了一通Jetson Nano的好处,昨天终于拿到货了。
配置环境参考:
贝克汉鸭的日志:https://blog.youkuaiyun.com/beckhans/article/category/8839715
云水木石的日志:https://blog.youkuaiyun.com/mogoweb/article/details/89889406
其他重要配置:
1. 配置SWAP:https://jkjung-avt.github.io/setting-up-nano/
2. 更换软件源:https://blog.youkuaiyun.com/qq_36396941/article/details/88903094
安装或编译其他软件时踩过的坑:
1. 设置用户时不要设置成自动登录,不然后面想要远程桌面的时候会无法登录。
2. 安装torch 1.1.0后,在python3中导入会提示numpy版本太低,需要升级。
pip3 install --upgrade numpy
3. PIP安装matplotlab的时候下载失败,更换成阿里云的源。
cd ~
mkdir .pip
nano .pip/pip.conf # 将下面的配置内容写入配置文件即可
[global]
trusted-host = mirrors.aliyun.com
index-url = http://mirrors.aliyun.com/pypi/simple
4. 安装matplotlab的时候编译失败,需要安装freetype
sudo apt-get install libfreetype6-dev
5. 安装OpenCV4.1的注意事项:
脚本参考:https://www.jianshu.com/p/a5d675f1b762
其中安装libjasper-dev会失败,需要如下处理:
更换源为16.04旧版本并安装:https://blog.youkuaiyun.com/cc13949459188/article/details/92837932
安装完之后再将源切换回新版本,记得要
sudo apt update
网络原因,下载face_landmark_model.dat可能失败,可以从github上手动下载。不过我多试了几次,下载成功了。
编译到python的时候会卡比较久,我是卡了差不多40分钟,几乎要手动中断的时候终于编译过了。
6. 调用CSI摄像头
查看摄像头参数:gst-inspect-1.0 nvarguscamerasrc
注意:很多博客这里写的是nvcamerasrc,实测不行。可能是版本不一样?
OpenCV打开IMX219-77可用的参数(输出的宽度高度随意):
'nvarguscamerasrc ! video/x-raw(memory:NVMM), width=1920, height=1080, format=(string)NV12, framerate=21/1 ! nvvidconv flip-method=2 ! video/x-raw, width=640, height=360, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink'
==================================================
如果不看GPU的话和树莓派差不多。