Docker TensorFlow
『pythonによるスクレイピング&機械学習 開発テクニック』
の5章 (5-2)だけ試してみた。
docker run -it b.gcr.io/tensorflow/tensorflow:latest-devel
本の通りにpython3で試したらエラー。
root@ac3b891d06fd:~# python3 Python 3.4.3 (default, Oct 14 2015, 20:28:29) [GCC 4.8.4] on linux Type "help", "copyright", "credits" or "license" for more information. >>> >>> import tensorflow as tf Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named 'tensorflow'
python 2系だといけた。
root@ac3b891d06fd:~# python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>>
>>> import tensorflow as tf
>>> sess = tf.Session()
>>> hello = tf.constant('Hello')
>>> sess.run(hello)
'Hello'
>>>
>>>
>>> a = tf.constant(10)
>>> b = tf.constant(32)
>>> sess.run(a+b)
42