LoginSignup
1
2

More than 5 years have passed since last update.

Chainer+CuPyをインストールしてみる(Ubuntu 16.04)

Posted at

目的

Chainerをpipでインストールする。
Cupyも入れてGPU込で学習ができるか確認する。

Installation guidelineを参考にする。
https://docs.chainer.org/en/stable/install.html#install-chainer

環境

Ubuntu 16.04.
GPUはRTX2080.

インストール

Anacondaでchainer仮想環境を作っておく。
pythonは3.6を使用。

conda create -n chainer python=3.6
conda activate chainer

下準備でpipを最新にしておく。

pip install -U setuptools pip

そしてChainerをpipで入れる。

pip install chainer

そしてCupyをインストール。
事前にCUDA, CuDNNのインストールが必要なのは注意。

(For CUDA 8.0)
# pip install cupy-cuda80

(For CUDA 9.0)
# pip install cupy-cuda90

(For CUDA 9.1)
# pip install cupy-cuda91

(For CUDA 9.2)
# pip install cupy-cuda92

(For CUDA 10.0)
pip install cupy-cuda100

全て正常に入ったか確認する。
Chainerがインポートできるか、そしてCUDA使用フラグが出ているか確認する。

python
> import chainer as chainer
> chainer.backends.cuda.available
# True
> chainer.backends.cuda.cudnn_enabled
# True

上記のように返ってきていれば環境設定はオッケー。
なんて簡単なんだ!^o^

CIFAR10で学習を試す。

TBD

まとめ

pipで全てインストールできるのでCUDAが入っていれば簡単だった(5分位?)。
Chainerチームありがとうございます。。!
早速学習を試してみたい。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2