[PYTHON] Since there is no description on how to build an environment for nnabla with Docker including GPU, I tried it myself Part 1

It seems that NNabla has been released by SONY! Let's skip the detailed explanation and use it immediately!

environment

First, install directly using pip

First, try installing directly in the virtual environment using pip. The version of cuDNN is different from 6.0 and the version 5.2 supported by __TensorFlow, so it is the one who does not use GPU.

Installation

$ conda create --name py27_nnabla python=2.7

For the time being, it seems that you can create an environment with conda and install it with pip, so I will try it. It seems that python3 series is not supported, so python2.7.

$ pip install nnabla

It didn't take long. Let's try the import code, which is the first step.

$ python -c "import nnabla"
2017-06-28 22:14:29,602 [nnabla][INFO]: Initializing CPU extension...

According to NNabla's site, it seems that it is installed, so let's run Example.

From nnabla repository, git clone and zip download.

Run the example code in the nnabla / examples / vision / mnist directory.

python classification.py

Of course, it will take some time.

……

If you take Mnist seriously, it shouldn't end in an hour, but what about that?

……

I confirmed that it works, so I interrupted the keyboard.

The main subject of this time is Docker.

Environment construction with Docker

How to run Docker ...

Run A Docker Image hosted on DockerHub

TODO.

Build Docker Image from source

TODO.

Gununu

Fortunately, the Dockerfile is open to the public, so let's do something about it here.

The execution method is not disclosed, but let's build and use the Docker file of NNabla!

Go to nnabla / docker

$ sudo bash ./docker-build develop-ubuntu16.04

This time I tried it with develop-ubuntu 16.04.

It will take some time, but I will wait this time. You should estimate at least a few tens of minutes.

After building the image, try running it.

$ docker run -it nbla:develop-ubuntu16.04

I will log in as root, so let's do something. For example, execute import

$ python -c "import nnabla"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named nnabla

Isn't it useless!

When I read the Dockerfile, I found that it seems that NNabla is not installed even if I execute it as described in the __README. Then I'll fall over, so I'll do something on my own.

Continue to the second part

Recommended Posts

Since there is no description on how to build an environment for nnabla with Docker including GPU, I tried it myself Part 1
I tried to build an environment for machine learning with Python (Mac OS X)
Since there was a doppelganger, I tried to distinguish it with artificial intelligence (laugh) (Part 2)
How to build an environment for using multiple versions of Python on Mac
I tried to build an environment of Ubuntu 20.04 LTS + ROS2 with Raspberry Pi 4
How to build a Django (python) environment on docker
[Go + Gin] I tried to build a Docker environment
I created an environment for Masonite, a Python web framework similar to Laravel, with Docker!
There was a doppelganger, so I tried to distinguish it with artificial intelligence (laughs) (Part 1)
I tried to build an environment where work in the Docker container on the remote server can be done directly from the local VS Code with SSH connection
Introducing Kaggle's Docker Image on Windows to build an environment
Anyone can understand how to build an initial environment for Python on Mac September 2016 (pyenv + virutalenv)
I tried to create an environment of MkDocs on Amazon Linux
Since ubuntu 20.04 is out, I will write a recipe for how to make an oleo distro (2020-06-04 version)
Since it is the 20th anniversary of the formation, I tried to visualize the lyrics of Perfume with Word Cloud
I tried to draw a system configuration diagram with Diagrams on Docker
I tried to install Docker on Windows 10 Home but it didn't work
I tried to build a Mac Python development environment with pythonz + direnv
How to prepare an environment with different python version and package for each project with pyenv-virtualenv on Amazon Linux
How to create an NVIDIA Docker environment
When I tried to create a virtual environment with Python, it didn't work
I made an image classification model and tried to move it on mobile
[I'm an IT beginner] I tried my best to implement Linux on Windows
I tried to create an environment to check regularly using Selenium with AWS Fargate
python> How to write multiple lines> How to write in mnist_with_summaries.py> It seems that there is no need for line concatenation symbols
When I tried to create a project using Python on Docker with PyCharm, it didn't work, but it worked with Docker Compose.