[PYTHON] Use chainer with Jetson TK1

1. Monitor and keyboard connection

(Supports HDMI only)

2. Turn on the power

3. Set the keyboard to Japanese

sudo dpkg-reconfigure keyboard-configuration

4. Initial setting

From ubuntu screen Login Run the installer

cd ~/NVIDIA-INSTALLER
sudo ./installer.sh
sudo reboot

After rebooting, you will be able to use ubuntu in the GUI.

5. Construction of the maternal environment (Ubuntu 14.04)

It seems that the Jetson TK1 development kit can only be installed from Ubuntu 14.04, so install Ubuntu 14.04 in Virtual Box.

Introduced extension pack so that USB can be used in Virtual box https://www.virtualbox.org/wiki/Downloads

See below if you want to increase the screen resolution http://mogi2fruits.net/blog/os-software/windows/2389/

6. Make Tk1 recognized from the mother Ubuntu

Connect your Mac and TK1 with a USB cable, hold down the force recovery button and press the reset button. If the screen goes black, you can start in recovery mode. In this state, from Virtual box settings → Port → USB If you click the USB additional Aincon on the right and the characters "NVIDIA Corp. ~" appear, you can recognize it from your Mac. (At this time, if you do not click "NVIDIA Corp. ~" once and check it, you can not see it from host Ubuntu, so be careful)

7. Download Jetpack for L4T

https://developer.nvidia.com/embedded/jetpack

8. Grant execute permission

In addition, it seems that execution fails in the Japanese directory, so Create an English directory and move files or grant execute permission.

chmod +x jetpack-${VERSION}.run

9. Run

Run the downloaded Jetpack.

You will be asked for Network Layout on the way, I was able to go normally with "Device access internet via router / switch". (It is necessary to match the network environment of the PC.)

When Flashing is over, Jetson will restart and you should see the normal screen.

Since the input device information screen is displayed on the mother's side, Set the Jetson IP. (Use arp-scan or something to identify the connected IP.)

sudo arp-scan -I xxxx -l

If you proceed well, the L4T setup will be completed. (Exit when the GUI is displayed on the Jetson screen.)

10. Set a fixed IP on Jetson for ssh

Add the following to / etc / network / interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.xxx.xxx
netmask 255.255.255.0
gateway 192.168.xxx.xxx
dns-nameservers 192.168.xxx.xxx

Reload

sudo /etc/init.d/networking restart

Now you have a fixed IP.

11.git install

Please enter from the following https://git-scm.com/book/ja/v1/%E4%BD%BF%E3%81%84%E5%A7%8B%E3%82%81%E3%82%8B-Git%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB

12. Python environment construction

Install pyenv

git clone https://github.com/yyuu/pyenv ~/.pyenv

Installation of dependent libraries

sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev
sudo apt-get install -y libreadline-dev libsqlite3-dev wget curl llvm

Pass the path to .bash_profile, .zshenv, etc.

export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

By the way, I will also pass the CUDA path. (If it is TX1, it should be cuda-7.0)

export PATH=/usr/local/cuda-6.5/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-6.5/lib64:$LD_LIBRARY_PATH

python installation

pyenv install 2.7.12

Create an appropriate directory, move to it and set python to specify

pyenv local 2.7.12

OK if 2.7.12 appears in the version check

python -V

Installation of related libraries

pip install --upgrade pip
pip install numpy
sudo apt-get install libatlas-base-dev gfortran
pip install scipy
pip install matplotlib
pip install scikit-learn
pip install pillow

13.chainer installation

sudo apt-get install python-dev python-virtualenv
pip install cython
sudo apt-get install libhdf5-dev
pip install chainer

Download sample code https://github.com/mattya/chainer-gogh

Go to the chainer-gogh directory and run

python chainer-gogh.py -m nin -i input.png -s style.png -o output_dir -g 0

The nin model seemed to work fine, i2v and so on are killed, so investigate.

At the time of execution

modprobe: FATAL: Module nvidia not found.

If you don't want to get an error like this, see below. http://qiita.com/suisuina/items/e1ce1d9805f4d8772594

Supplement

Check swap status

sudo cat /proc/swaps

swap creation (When swapping with USB etc., check the USB path with sudo fdisk -l and replace the / var / swap / part below)

sudo mkdir /var/swap/
sudo dd if=/dev/zero of=/var/swap/swap0 bs=2M count=2048
sudo chmod 600 /var/swap/swap0

Assign swap file to swap

sudo mkswap /var/swap/swap0
sudo swapon /var/swap/swap0

Make it set as a swap file at startup

 sudo vi /etc/fstab

Add the following /var/swap/swap0 swap swap defaults 0 0

Unswap

sudo swapoff -a

Change user to root

sudo su -

shut down

sudo shutdown -h now

Reboot

sudo shutdown -r now

System layout system_layout.jpg

Regarding the error when using i2v, when I swapped the memory, it seems that it is not executed with "Memory Error". Maybe it's 32bit, so I wonder if it's done with the upper limit of 4G. ..

reference http://qiita.com/ktyubeshi/items/847b05b7879e2f45da54

http://developer.download.nvidia.com/embedded/jetson/TK1/docs/2_GetStart/Jeston_TK1_QuickStartGuide.pdf#nameddest=Introduction

http://qiita.com/0x0c@github/items/bc2683b00617981e4468

http://vboxmania.net/content/%E3%82%A8%E3%82%AF%E3%82%B9%E3%83%86%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%B3%E3%83%91%E3%83%83%E3%82%AF%E3%81%AE%E5%B0%8E%E5%85%A5

http://mogi2fruits.net/blog/os-software/windows/2389/

USB format http://qiita.com/suisuina/items/690feac29bbfeec2da64 swap http://qiita.com/scleen_x_x/items/f3fc492bcbf0f6c2896c

Recommended Posts

Use chainer with Jetson TK1
Use tensorboard with Chainer
Use PX-S1UD / PX-Q1UD with Jetson nano
Seq2Seq (1) with chainer
Use mecab-ipadic-neologd with igo-python
Use ansible with cygwin
Use pipdeptree with virtualenv
[Python] Use JSON with Python
Use Mock with pytest
Use indicator with pd.merge
Use Gentelella with django
Use mecab with Python3
Use DynamoDB with Python
Use pip with MSYS2
Use Python 3.8 with Anaconda
Use pyright with Spacemacs
Use python with docker
Use TypeScript with django-compressor
Use LESS with Django
Use MySQL with Django
Use Enums with SQLAlchemy
Use tensorboard with NNabla
Use GPS with Edison
Use nim with Jupyter
Use scikit-learn training dataset with chainer (for learning / prediction)
Autoencoder with Chainer (Notes on how to use + trainer)
Use Trello API with python
Use shared memory with shared libraries
Use custom tags with PyYAML
Use directional graphs with networkx
Use TensorFlow with Intellij IDEA
Try implementing RBM with chainer.
Use Twitter API with Python
How to use Realsense's Python wrapper PyRealsense with Jetson Nano
Use pip with Jupyter Notebook
Use DATE_FORMAT with SQLAlchemy filter
Use TUN / TAP with Python
Learn elliptical orbits with Chainer
Seq2Seq (3) ~ CopyNet Edition ~ with chainer
Jetson Nano JETPACK 44.1 (2020/10/21) with Tensorflow
Use SSL with Celery + Redis
Use Cython with Jupyter Notebook
Neural network starting with Chainer
Use Maxout + CNN with Pylearn2
Implemented Conditional GAN with chainer
Image caption generation with Chainer
Use WDC-433SU2M2 with Manjaro Linux
Use OpenBLAS with numpy, scipy
Use subsonic API with python3
Implemented SmoothGrad with Chainer v2
Use Sonicwall NetExtener with Systemd
Deep Embedded Clustering with Chainer 2.0
A little stuck with chainer
Use prefetch_related conveniently with Django
Use AWS interpreter with Pycharm
Use Bokeh with IPython Notebook
Use Python-like range with Rust
Use MLflow with Databricks ④ --Call model -
Use pyright with CentOS7, emacs lsp-mode
Python: How to use async with
Use Azure SQL Database with SQLAlchemy