Linuxプラットフォーム用「MXNet 0.9.3」がPyPIに登録されていたので、Dockerコンテナにインストールしてみました。
PyPIに登録されているMXNetは、
- CPU版の「mxnet 0.9.3」
- CUDA 7.5版の「mxnet-cu75 0.9.3」
- CUDA 8.0版の「mxnet-cu80 0.9.3」
でしたが、今日(2月20日)確認してみると、MKLML版の「mxnet-mkl 0.9.3」が追加され、「mxnet 0.9.3」の代わりに「mxnet 0.9.4」(GitHubの最新tagが、0.9.3aなので???)となっていました。
(2017/02/26追記)
CPU版・CUDA 7.5版・CUDA 8.0版が、それぞれ「mxnet 0.9.3a3」・「mxnet-cu75 0.9.3a3」・「mxnet-cu80 0.9.3a3」で、暫くは落ち着いているようです。
今回は、CUDA 8.0版の「mxnet-cu80 0.9.3」をインストールしてみます。
mxnet-cu80のインストール
以下のコマンドで、CUDA 8.0とcuDNN 5.1の入ったコンテナを起動します。
$ nvidia-docker run -it --name mxnet-cu80 \ nvidia/cuda:8.0-cudnn5-runtime-ubuntu14.04 /bin/bash
起動したコンテナでは、以下のコマンドで、pipをインストールします。
# apt-get update # apt-get install python-pip
さすがに、これだけでは無理だろうと思いながら、以下のコマンドを実行します。
# pip install mxnet-cu80 Downloading/unpacking mxnet-cu80 Could not find any downloads that satisfy the requirement mxnet-cu80 Cleaning up... No distributions at all found for mxnet-cu80 Storing debug log for failure in /root/.pip/pip.log
「mxnet-cu80」のインストールは失敗です。
その後は、python-numpy、python-dev等のパッケージをインストールしたあとで、「mxnet-cu80」のインストールを試してみましたが、状況は変わらず。必要なパッケージが分かりません。
これでダメならあきらめようと、最後にインストールしたのが、全部入りのPython 3.6版の「Anaconda 4.3.0」。
Python環境を切り替えた後で、以下のコマンドを実行します。
# pip install mxnet-cu80 Collecting mxnet-cu80 Downloading mxnet_cu80-0.9.3-cp36-cp36m-manylinux1_x86_64.whl (51.1MB) …… Requirement already satisfied: numpy in ./anaconda3/lib/python3.6/site-packages (from mxnet-cu80) Installing collected packages: mxnet-cu80 Successfully installed mxnet-cu80-0.9.3
「mxnet-cu80」のインストールに成功しました。
上記のRequirement already satisfied: numpy
から判断すると、やはりnumpyのバージョンが合わなかったのかなー、pipが古かったのかなー。
まとめ
今回の結論としては、Chainerのようにpipで簡単インストールとは行きませんが、全部入りのPython 3.6版の「Anaconda 4.3.0」をインストールしたあとであれば、pipでCUDA 8.0版の「mxnet-cu80 0.9.3」をインストールできました。