I tried to copy this book or download a sample and try to run it, but because the version of tensorflow is 1.15, I could not move it obediently with NVIDIA L4T ML provided by Nvidia NGC.
So, I built a Docker environment so that the sample of tensorflow 1.15 can be run almost as it is.
Build failed without adding swap to Jetson nano. Create a swap file of about 6GB. → https://qiita.com/n-yamanaka/items/dd82996312ab333fe9b2
Dockerfile
I uploaded it to github. → https://github.com/Nunocky/JetsonNano_Docker_Containers
FROM nvcr.io/nvidia/l4t-tensorflow:r32.4.4-tf1.15-py3
RUN apt-get update
RUN apt-get install -y fonts-ipaexfont
RUN apt-get install -y libffi-dev
RUN apt-get install -y python-pip
RUN apt-get install -y python3-pip
RUN pip3 install -U pip
RUN pip3 install notebook
RUN pip3 install matplotlib
RUN pip3 install pandas
RUN pip3 install scipy
RUN pip3 install opencv-contrib-python
RUN mkdir /tf
RUN chmod 777 /tf
ADD jupyter_notebook_config.py /root/.jupyter/
CMD ["jupyter", "notebook"]
Prepare jupyter_notebook_config.py in the same location as Dockerfile. I set the Jupyter notebook password to jetsonnano. If you want to change your password You can refer to here.
jupyter_notebook_config.py
c.NotebookApp.notebook_dir = '/tf'
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
c.NotebookApp.password = u'argon2:$argon2id$v=19$m=10240,t=10,p=8$kDrfziXaxPvbrLZfP2oTKA$zSNR85lqmziWEVjx/ApauQ'
Build if you can do so far
sudo docker build -t tensorflow:1 .
It takes several hours to build matplotlib, opencv, etc.
sudo docker run -it --rm --runtime nvidia --network host tensorflow:1
You don't have to delete the work record by associating the host directory with /tf
on the docker container with the
-v``` option at startup, but that's the basic story of docker, so I'll omit it.
tensorboard is executed by docker exec from Jetson nano.
sudo docker exec -it <container id> tensorboard --host 0.0.0.0 --logdir /tf/log --port 6006
The sample from Chapter 10 that handles a large number of images may not work with ResourceExhaustedError as it is.
It worked but stopped pic.twitter.com/ g4wxNOIi7V
& mdash; NUNOKAWA Masato (@Nunocky) December 28, 2020 >
In that case, adjust the number of batches and epochs and change the size of the data passed to the GPU.
Recommended Posts