TensorFlow@2017.11.23

————————————
TensorFlow+TFlearnインストール on Mac
————————————
Deep learning実装のため、Python 3.6の仮想環境を作成。
$conda create -ntfbook
$source activate tfbook

このあと、TensorFlowをインストールしようとするが、以下のエラーメッセージで弾き返される。
Trouble installing TensorFlow (No matching distribution found for tensorflow==1.0)

python3 on Mac OS Xの場合、以下で作動した。
$pip install –upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.10.0-py3-none-any.whl
>Successfully installed protobuf-3.0.0b2 setuptools-37.0.0 tensorflow-0.10.0 wheel-0.30.0

$ python
Python 3.6.3 |Anaconda custom (64-bit)| (default, Oct 6 2017, 12:04:38)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import tensorflow
>>> exit()

次にTFlearnをインストール
$ pip install tflearn
Collecting tflearn
Downloading tflearn-0.3.2.tar.gz (98kB)
100% |????????????????????????????????| 102kB 490kB/s
Requirement already satisfied: numpy in ./anaconda3/lib/python3.6/site-packages (from tflearn)
Requirement already satisfied: six in ./anaconda3/lib/python3.6/site-packages (from tflearn)
Requirement already satisfied: Pillow in ./anaconda3/lib/python3.6/site-packages (from tflearn)
Requirement already satisfied: olefile in ./anaconda3/lib/python3.6/site-packages (from Pillow->tflearn)
Building wheels for collected packages: tflearn
Running setup.py bdist_wheel for tflearn … done
Stored in directory: /Users/….
Successfully built tflearn
Installing collected packages: tflearn
Successfully installed tflearn-0.3.2

$ python
Python 3.6.3 |Anaconda custom (64-bit)| (default, Oct 6 2017, 12:04:38)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.>>> import tensorflow
>>> import tflearn
Traceback (most recent call last):
File ““, line 1, in
File “/Users/teijisw/anaconda3/lib/python3.6/site-packages/tflearn/__init__.py”, line 4, in
from . import config
File “/Users/teijisw/anaconda3/lib/python3.6/site-packages/tflearn/config.py”, line 5, in
from .variables import variable
File “/Users/teijisw/anaconda3/lib/python3.6/site-packages/tflearn/variables.py”, line 7, in
from tensorflow.contrib.framework.python.ops import add_arg_scope as contrib_add_arg_scope
ImportError: cannot import name ‘add_arg_scope’
>>> import tensorflow.python.ops.tensor_array_ops
Traceback (most recent call last):
File ““, line 1, in
ModuleNotFoundError: No module named ‘tensorflow.python.ops.tensor_array_ops’
>>> import tflearn
Traceback (most recent call last):
File ““, line 1, in
File “/Users/teijisw/anaconda3/lib/python3.6/site-packages/tflearn/__init__.py”, line 4, in
from . import config
File “/Users/teijisw/anaconda3/lib/python3.6/site-packages/tflearn/config.py”, line 5, in
from .variables import variable
File “/Users/teijisw/anaconda3/lib/python3.6/site-packages/tflearn/variables.py”, line 7, in
from tensorflow.contrib.framework.python.ops import add_arg_scope as contrib_add_arg_scope
ImportError: cannot import name ‘add_arg_scope’
>>> exit()

要するに、Pythonを立ち上げて、tensorflowのimportのあとて、tflearnのimportで
ImportError: cannot import name ‘add_arg_scope’
と、エラー!
$export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow_gpu-1.1.0-py3-none-any.whl
$sudo pip3 install $TF_BINARY_URL
TensorFlowのバージョンをあげて、対応してみたけど、同じくtflearnはエラーが出てimportできない。
anaconda, pythonの仮想環境…よく理解できていないので、
よくわからないが、Mac OS Xの環境で、Python 3.6 + TensorFlow 0.10.0 + tflearn 0.3.2では、相性が悪いんだろう。
早々にMac OS Xを諦めて、Mac OS Xに Oracle Virtual Box + Linux Ubuntu をインストールして利用する方針に変更
————————————