赞
踩
首先在虚拟机上安装一个新的ubuntu18.04
iso下载地址Ubuntu 18.04.6 LTS (仿生海狸)
下载后即可安装,安装方式参考这篇文章 复制如下:
参考这篇文章可以实现ubunt和Win的双向复制功能:
VMware上面实现Ubuntu和Windows文件的复制粘贴功能
tx2模块简介
首先下载NVIDIA SDK Manager 英伟达 SDK 管理器|英伟达开发者 (nvidia.com)
打开终端执行
- sudo apt install ./sdkmanager_1.8.1-10392_amd64.deb
- sdkmanager
-
- #卸载命令(不执行)
- sudo apt-get --purge remove sdkmanager
点击LOGIN,注册账号后选择JetPack4.x版本
先进入TX2恢复模式(先关机,再点按开机键S4,按住S3,点按S1,松开S3即可)
选中红圈部分,并输入虚拟机密码
选择Manual setup 账户密码为你想新创立的账户密码
在下面那条进度线快到50%的时候,显示屏会亮,设置用户名和密码,同时主机端也会跳出一个窗口,要求输入用户名和密码,此时记得将tx2连接到与主机的同一个网路上。
然后慢慢等待安装即可 (注:host端的CUDA安装失败没有关系)
首先在ZED官网下载ZED SDK
- chmod +x ZED_SDK_Tegra_L4T32.7_v3.7.6.run
- ./ZED_SDK_Tegra_L4T32.7_v3.7.6.run
先输入q再一路输入y。
- cd /usr/local/zed/tools/
- #Explorer模式
- ./"ZED Explorer"
- #深度模式
- ./"ZED Depth Viewer"
参考这篇文章
step1:添加源
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
step2:设置秘钥
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
step3:更新并安装
- sudo apt update
-
- sudo apt install ros-melodic-desktop-full
step4:初始化rosdep
- sudo apt install python-rosdep
- sudo rosdep init
- rosdep update
step5:环境配置
- echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
- source ~/.bashrc
-
- source /opt/ros/melodic/setup.bash
step6:添加一些依赖
sudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential
step7:运行检查
- roscore
- rosrun turtlesim turtlesim_node
- rosrun turtlesim turtle_teleop_key
step1:下载
git clone https://github.com/AlexeyAB/darknet.git yolo4
step2:配置makefile文件
注意:配置ARCH时可以先去NVIDIA官网查看TX2算力,TX2算力如下:
GPU=1
CUDNN=1
CUDNN_HALF=0
OPENCV=1
AVX=0
OPENMP=0
LIBSO=1
ZED_CAMERA=1
ZED_CAMERA_v2_8=0
#找ARCH,修改如下
ARCH= -gencode arch=compute_62,code=[sm_62,compute_62]
#找NVCC,修改如下
NVCC=/usr/local/cuda-10.2/bin/nvcc
step3:编译
sudo make -j8
step4:在主目录下下载权重文件
https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-tiny.weights
https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4.weights
- #yolov4-tiny.weights
- wget https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-tiny.weights
- #yolov4.weights
- wget https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4.weights
step5:测试
- #图片
- ./darknet detector test cfg/coco.data cfg/yolov4-tiny.cfg yolov4-tiny.weights data/dog.jpg
- ./darknet detector test cfg/coco.data cfg/yolov4.cfg yolov4.weights data/dog.jpg
-
- #视频
- ./darknet detector demo cfg/coco.data cfg/yolov4-tiny.cfg yolov4-tiny.weights data/sample.mp4
- ./darknet detector demo cfg/coco.data cfg/yolov4-tiny.cfg yolov4-tiny.weights data/sample.mp4
-
- #实时测试板载摄像头 (CSI摄像头实时检测)
-
- ./darknet detector demo cfg/coco.data cfg/yolov4-tiny.cfg yolov4-tiny.weights "nvarguscamerasrc ! video/x-raw(memory:NVMM), width=1280, height=720, format=NV12, framerate=30/1 ! nvvidconv flip-method=0 ! video/x-raw, width=1280, height=720, format=BGRx ! videoconvert ! video/x-raw, format=BGR ! appsink"
-
-
- ./darknet detector demo cfg/coco.data cfg/yolov4.cfg yolov4.weights "nvarguscamerasrc ! video/x-raw(memory:NVMM), width=1280, height=720, format=NV12, framerate=30/1 ! nvvidconv flip-method=0 ! video/x-raw, width=1280, height=720, format=BGRx ! videoconvert ! video/x-raw, format=BGR ! appsink"
-
- #实时检测usb摄像头
- ./darknet detector demo cfg/coco.data cfg/yolov4-tiny.cfg yolov4-tiny.weights -c 1
- ./darknet detector demo cfg/coco.data cfg/yolov4.cfg yolov4.weights -c 1
查看opencv版本:
pkg-config --modversion opencv
查看CUDA安装位置:
sudo find /usr -iname "nvcc"
查看CUDA版本:
cat /usr/local/cuda/version.txt
查看CUDNN版本:
cat /usr/include/cudnn.h | grep CUDNN_MAJOR -A 2
查看以及切换python版本 :
TX2配套安装了python2和python3
python --version
默认为python2,可切换为python3
- sudo echo alias python=python3 >> ~/.bashrc
- source ~/.bashrc
还可切换回python2
- sudo echo alias python=python2 >> ~/.bashrc
- source ~/.bashrc
查看numpy版本:
- python
- import numpy
- print(numpy.__version__)
step1:安装jetson-stats
sudo -H pip install jetson-stats
step2:启动jetson-stats
sudo jtop
可以看到按2 3 4 可以查看GPU CPU CTRL
step3:设置开机启动风扇
按数字键5进入CTRL界面 ,并按S和E,设置jetson_clocks Running和boot Enable,如图所示:
最后按q推出当前界面,重启设备即可
参考:Jetson TX2 power mode功耗模式
TX2有4种模式,可以用nvpmodel命令工具进行设置
设置为10w模式(高功耗模式,用6个CPU)
sudo nvpmodel -m 0
设置为5w模式(只用4个CPU)
sudo nvpmodel -m 1
开启风扇,开启最大clock时钟
sudo /usr/bin/jetson_clocks
还可以查看当前功耗模式
sudo nvpmodel -q verbose
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。