python3 の環境に chainer をインストールしました。

$ pip3 install chainer
Collecting chainer
Downloading https://files.pythonhosted.org/packages/bd/34/be31d10ff7f6a9452025866a6d515e1fbc877ff2ee68d9c7197c75f15797/chainer-5.0.0.tar.gz (510kB)
100% |████████████████████████████████| 512kB 2.4MB/s
Collecting filelock (from chainer)
Downloading https://files.pythonhosted.org/packages/d7/ca/3c74396a9ed8a4cfab5459800edeef9a1269591cb21f5a49bd71a49c5fa2/filelock-3.0.10-py3-none-any.whl
Collecting numpy>=1.9.0 (from chainer)
Downloading https://files.pythonhosted.org/packages/3d/c3/a69406093c9a780a74964f41cd56b06c0346d686a9b3f392d123a663f5e0/numpy-1.15.4-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (24.5MB)
100% |████████████████████████████████| 24.5MB 1.8MB/s
Collecting protobuf>=3.0.0 (from chainer)
Downloading https://files.pythonhosted.org/packages/18/e7/785830a65d1f1faba7dccfa8314f7afded1db8cc2860218226ba4b3f6150/protobuf-3.6.1-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (1.2MB)
100% |████████████████████████████████| 1.2MB 2.7MB/s
Collecting six>=1.9.0 (from chainer)
Downloading https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Requirement already satisfied: setuptools in /usr/local/lib/python3.7/site-packages (from protobuf>=3.0.0->chainer) (40.5.0)
Building wheels for collected packages: chainer
Running setup.py bdist_wheel for chainer … done
Stored in directory: /Users/toshisan/Library/Caches/pip/wheels/96/85/2e/623d0d0f08db6eb8d75cdb89c094674c98e2304ff5d98528aa
Successfully built chainer
Installing collected packages: filelock, numpy, six, protobuf, chainer
Successfully installed chainer-5.0.0 filelock-3.0.10 numpy-1.15.4 protobuf-3.6.1 six-1.11.0

環境の確認

下記のようなプログラムで確認しました。

import chainer

print(“Hello”)

動かしてみました。

$ python3 test.py

/usr/local/lib/python3.7/site-packages/chainer/_environment_check.py:38: UserWarning: Accelerate has been detected as a NumPy backend library.
vecLib, which is a part of Accelerate, is known not to work correctly with Chainer.
We recommend using other BLAS libraries such as OpenBLAS.
For details of the issue, please see
https://docs.chainer.org/en/stable/tips.html#mnist-example-does-not-converge-in-cpu-mode-on-mac-os-x.

Also note that Chainer does not officially support Mac OS X.
Please use it at your own risk.

”’) # NOQA
Hello

”Hello”ッテ表示はしたんですが、その前にあれこれ。。。さてさて。。。

調査

Accelerate has been detected as a NumPy backend library.
AccelerateがNumPyバックエンドライブラリとして検出されました。

vecLib, which is a part of Accelerate, is known not to work correctly with Chainer.
Accelerateの一部であるvecLibは、Chainerで正しく動作しないことが知られています。

We recommend using other BLAS libraries such as OpenBLAS.
OpenBLASなどの他のBLASライブラリを使用することをお勧めします。

なるほど。。。

詳細はこちらを見ろとのこと。。

https://docs.chainer.org/en/stable/tips.html#mnist-example-does-not-converge-in-cpu-mode-on-mac-os-x.

続きは別ページで。。