构建属于你自己的Jetbot
1. 烧录Jetpack 镜像到SD卡 Jetson Download Center
使用的账户和密码均为Jetbot
确认使用自动登录
2. 将SD卡插入Jetson Nano 并开机进入命令行
3. 启用IC2权限
sudo usermod -aG i2c $USER
4. 安装pip和python依赖项
sudo apt-get update
sudo apt install python3-pip python3-pil
sudo pip3 install --upgrade numpy
5. 安装Tensorflow
sudo apt-get update
sudo apt-get install libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev liblapack-dev libblas-dev gfortran
sudo apt-get install python3-pip
sudo pip3 install -U pip testresources setuptools==49.6.0
sudo pip3 install --pre --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v42 tensorflow-gpu
注:验证Tensorflow安装在命令行输入python3进入python环境,然后在python环境内输入import tensorflow,如果没有报错,则tensorflow安装成功
6. 安装PyTorch
注:需要先下载该文件并上传至/home/jetbot/目录 点我进入下载界面
sudo pip3 install torch-1.0.0a0+18eef1d-cp36-cp36m-linux_aarch64.whl
sudo pip3 install torchvision
7. 安装Traitlets
sudo -H python3 -m pip install traitlets==4.3.3
8. 安装Jupter Lab依赖项
sudo apt update
sudo apt -y install curl dirmngr apt-transport-https lsb-release ca-certificates
curl -sL https://deb.nodesource.com/setup_10.x | sudo bash
sudo apt update
sudo apt -y install nodejs npm
9. 安装Jupter Lab
sudo pip3 install jupyter jupyterlab
sudo jupyter labextension install @jupyter-widgets/jupyterlab-manager
sudo jupyter labextension install @jupyterlab/statusbar
jupyter lab --generate-config
# 设置Jupyter Lab密码
jupyter notebook password
# 修改Jupyter Lab配置文件
cd ~/jupyter
sudo nano jupyter_notebook_config.py
# 向配置文件末尾添加如下两行
# c.NotebookApp.allow_origin = '*’
# c.NotebookApp.ip = '0.0.0.0’
10. 安装这个Repo
cd ~
sudo apt install python3-smbus
# 将Jetbot项目从Github克隆下来
git clone https://github.com/NVIDIA-AI-IOT/jetbot
cd jetbot
sudo apt-get install cmake
sudo python3 setup.py install
11. 安装Jetbot服务
cd jetbot/utils
python3 create_stats_service.py
sudo mv jetbot_stats.service /etc/systemd/system/jetbot_stats.service
sudo systemctl enable jetbot_stats
sudo systemctl start jetbot_stats
python3 create_jupyter_service.py
sudo mv jetbot_jupyter.service /etc/systemd/system/jetbot_jupyter.service
sudo systemctl enable jetbot_jupyter
sudo systemctl start jetbot_jupyter
12. 创建文件交换(SWAP)
sudo fallocate -l 4G /var/swapfile
sudo chmod 600 /var/swapfile
sudo mkswap /var/swapfile
sudo swapon /var/swapfile
sudo bash -c 'echo "/var/swapfile swap swap defaults 0 0" >> /etc/fstab'
13. 将Jetbot notebook复制到/home/jetbot/下
cp -r ~/jetbot/notebooks ~/Notebooks
参考文章:
https://github.com/NVIDIA-AI-IOT/jetbot/wiki/Create-SD-Card-Image-From-Scratch
https://forums.developer.nvidia.com/t/official-tensorflow-for-jetson-nano/71770
https://computingforgeeks.com/installing-node-js-10-lts-on-ubuntu-18-04-16-04-debian-9/