5% OFF Over $19, Code: Elephant5; 10% OFF Over $59, Code: Elephant10



2.4 Install Jetbot

Posted by Fiona Su on

1. Enable peripheral permissions we will use

1.1 Input this command to get permission to use gpio:

sudo usermod -a -G gpio jetbot

(jetbot is the current username)

1.2 Input this command to get permission to use i2c:

sudo usermod -a -G i2c jetbot

(jetbot is the current username)

In the case of a serial port. In Linux system, for non-root users, there is no read/write permission for serial devices by default.

I will tell you how to let ordinary users do not use sudo to have read and write permissions on serial devices. The serial port peripheral name used by Jetbot is ttytTHS1:

Temporary processing:

sudo chmod 777 /dev/ttyUSB0

Permanent treatment:

sudo usermod -aG dialout jetbot

Where jetbot is the current username

(jetbot is the current username)

2. Install TensorFlow

2.1 Preparation:

2.1.1 Install the system package according to the requirements of TensorFlow:

sudo apt-get install libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev 

2.1.2 Install and update PIP3。

sudo apt-get install python3-pip 

sudo pip3 install -U pip

2.1.3 Input this command to install Python package:

sudo pip3 install -U numpy grpcio absl-py py-cpuinfo psutil portpicker six mock requests gast h5py astor termcolor protobuf keras-applications keras-preprocessing wrapt google-pasta setuptools testresources

As shown below: image.png

2.2 Installation:

Because the firewall between the domestic network and the external network is isolated, the access speed of the external network is relatively slow. Therefore, the first local installation method can be used to complete the installation more stably and quickly.

Method 1 of installation: local installation

1)Transfer the TensorFlow installation package to the Jetbot file system via WinSCP or other file transfer tool.

Path of package : [Jetbot-AI Car] --> [Annex] --> [Library and model]---> [TensorFlow Installation Package]

image.png 

2) In the linux command console to the directory where the file is stored, use the following command to install

sudo pip3 install tensorflow_gpu-1.13.1+nv19.3-cp36-cp36m-linux_aarch64.whl 

After installation, TensorFlow is installed.

Method 2 of installation: online installation

Input this command to install TensorFlow package:

sudo pip3 install --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v42 tensorflow-gpu == 1.13.1 + nv19.3

As shown below:

image.png

3. Install Pytorch

Because TensorFlow have been installed , some dependencies and libraries are installed, so we are now installing Pytorch directly.

1) Transfer Pytorch installation package to the Jetbot file system via WinSCP or other file transfer tool.

 image.png

2) In the linux command console to the directory where the file is stored, use the following command to install:

sudo pip3 install torch-1.0.0a0+18eef1d-cp36-cp36m-linux_aarch64.whl

3) Use the following command to install torchvision:

sudo pip3 install torchvision

4. Preload the desired model to the local area in advance

1) Transfer the two model packages in home-jetbot-.torch-models to the Jetbot file system via WinSCP or other file transfer tool.

Path of package : [Jetbot-AI Car] --> [Annex] --> [Library and model]---> [Pre-training model]---> [home-jetbot-.torch-models] 

image.png 

2) copy the model to the Jetbot target folder /home/jetbot/.torch/models by using the cp command.

sudo cp (the current model is located in the Jetbot file system) /home/jetbot/.torch/models/

5. Install Jupyter Lab

Use the following command to install the Jupyter Lab in order:

1) Installation dependencies:

sudo apt install nodejs npm

2) Install jupyterlab:

sudo pip3 install jupyter jupyterlab

sudo jupyter labextension install @jupyter-widgets/jupyterlab-manager

sudo jupyter labextension install @jupyterlab/statusbar

Generate the appropriate configuration file:

jupyter lab --generate-config

Set the password to enter the notebook (this will be set twice, the second time to confirm the entered password):

jupyter notebook password

When you log in to your notebook for the first time, you need to enter the password you set here to enter.

!Note: please be sure to remember the currently set password!

6. Install Jetbot firmware

Transfer the jetbot package to the Jetbot file system /home directory via WinSCP or other file transfer tool.

Path of package : [Jetbot-AI Car] --> [Annex] --> [Jetbot Package]---> [jetbot]

Then go to the /home/jetbot file directory in the command console.

cd /home/jetbot/

Then use the following command to install the jetbot firmware.

sudo python3 setup.py install

7. Install Jetbot boot self-start service

In the command console, go to the Jetbot firmware package /home/jetbot file directory transferred in last section.

Under the Utils directory:

cd jetbot/utils

Run the create_stats_service.py file to generate the stats_service.service file:

python3 create_stats_service.py 

Then move the generated service file to the system service:

sudo mv jetbot_stats.service /etc/systemd/system/jetbot_stats.service

Enable the service:

sudo systemctl enable jetbot_stats

Manually open the service

sudo systemctl start jetbot_stats

Run the create_stats_service.py file to generate the jupyter_service.service file:

python3 create_jupyter_service.py

Then move the generated service file to the system service:

sudo mv jetbot_jupyter.service /etc/systemd/system/jetbot_jupyter.service

Enable the service:

sudo systemctl enable jetbot_jupyter

Manually open the service:

sudo systemctl start jetbot_jupyter

8. Move the Notebook source package to the Jetbot home directory

In the command console, go to the Jetbot firmware package /home/jetbot file directory transferred in section 6.

 cp -r ~/jetbot/Notebooks ~/Notebooks

Tutorial

Buy Yahboom Jetbot AI robot with HD Camera Coding with Python for Jetson Nano

0 comments

Leave a comment

Please note, comments must be approved before they are published