DIGITSをdockerで構築(さくらのクラウドを利用)
NVIDIA社が提供しているDIGITSはCaffeをGUIで比較的簡単に扱うことができるツールです。
今まで公式のセットアップ方法やネット上の情報などでCaffeの環境構築に挫折した人でも比較的簡単に環境構築もできます。
さくらのクラウドにubuntu14.04でインスタンスができている前提で書きます。
※ 「比較的」です。ある程度の知識は必要です
さくらのクラウドにSSHで接続
まず、dockerのインストールが必要です。
~$ wget -qO- https://get.docker.com/ | sh
sudo: unable to resolve host XXX
[sudo] password for ubuntu:
~$ docker version
Client:
Version: 1.9.1
API version: 1.21
Go version: go1.4.2
Git commit: a34a1d5
Built: Fri Nov 20 13:12:04 UTC 2015
OS/Arch: linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
Docker deamonと繋がらないと言ってますが、無視します。sudoしたら動きました。
~$ sudo docker run hello-world
sudo: unable to resolve host XXX
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
b901d36b6f2f: Pull complete
0a6ba66e537a: Pull complete
Digest: sha256:8be990ef2aeb16dbcb9271ddfe2610fa6658d13f6dfb8bc72074cc1ca36966a7
Status: Downloaded newer image for hello-world:latest
Hello from Docker.
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker Hub account:
https://hub.docker.com
For more examples and ideas, visit:
https://docs.docker.com/userguide/
DIGITSのdocker imageを入れる
Docker HubにDIGITSがありますので、これをインストールpullします。
~$ sudo docker pull kaixhin/digits
sudo: unable to resolve host XXX
Using default tag: latest
latest: Pulling from kaixhin/digits
e20a84c3233b: Pull complete
d6c64ee0ce32: Pull complete
d8d3e3b9a2f4: Pull complete
ce76de2e871b: Pull complete
5694be68f2de: Pull complete
3ad092f3904b: Pull complete
08da567e0717: Pull complete
ff5fd15772e3: Pull complete
c5f5f2551958: Pull complete
a39285e4b559: Pull complete
9c295a69355d: Pull complete
d89960b7d7ad: Pull complete
Digest: sha256:81ae974af238dd3088c40427b81bdeaea42ae641bb26cd3820b2159e67c8104d
Status: Downloaded newer image for kaixhin/digits:latest
pullが終わったら、docker imagesで確認してみます。
~$ sudo docker images
sudo: unable to resolve host XXX
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
kaixhin/digits latest d89960b7d7ad 3 days ago 1.615 GB
hello-world latest 0a6ba66e537a 4 months ago 960 B
問題なくpull出来たことを確認したら、ポート番号5000をホストとつなげてdocker runします。
~$ sudo docker run -it -p 5000:5000 kaixhin/digits /bin/bash
これで、ブラウザからポート番号5000に接続すると、DIGITSの画面が表示されるはずです。
あとは、公式のGetting startに沿って、テストをしてみてください。