Python

TensorFlow を使ってみる

このページのままやってみた。

http://blog.btrax.com/jp/2015/11/29/tensorflow/

環境: macOS High Sierra (10.13)

bash-3.2$ sudo -H pip install --upgrade virtualenv
You are using pip version 6.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting virtualenv
 Downloading virtualenv-15.1.0-py2.py3-none-any.whl (1.8MB)
 Installing collected packages: virtualenv
Successfully installed virtualenv-15.1.0
bash-3.2$ virtualenv --system-site-packages ~/tensorflow
New python executable in /Users/bear/tensorflow/bin/python
Installing setuptools, pip, wheel...done.
bash-3.2$ cd tensorflow/
bash-3.2$ source bin/activate
(tensorflow) bash-3.2$ pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
Collecting tensorflow==0.5.0 from https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
 Downloading https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl (9.8MB)
Collecting numpy>=1.9.2 (from tensorflow==0.5.0)
 Downloading numpy-1.13.3-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (4.6MB)
Collecting six>=1.10.0 (from tensorflow==0.5.0)
 Downloading six-1.11.0-py2.py3-none-any.whl
Installing collected packages: numpy, six, tensorflow
 Found existing installation: numpy 1.8.0rc1
   Not uninstalling numpy at /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python, outside environment /Users/bear/tensorflow
 Found existing installation: six 1.4.1
   Not uninstalling six at /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python, outside environment /Users/bear/tensorflow
Successfully installed numpy-1.13.3 six-1.11.0 tensorflow-0.5.0
(tensorflow) bash-3.2$

CPU コア数に関するメッセージが出る

>>> sess = tf.Session()
sess = tf.Session()
can't determine number of CPU cores: assuming 4
I tensorflow/core/common_runtime/local_device.cc:25] Local device intra op parallelism threads: 4
can't determine number of CPU cores: assuming 4
I tensorflow/core/common_runtime/local_session.cc:45] Local session inter op parallelism threads: 4

https://qiita.com/spinute/items/d2c7fc34bdcc52993c12 このページを参考にして、コア数を教えてみたら、消えた。

>>> NUM_CORES = 4
NUM_CORES = 4
>>> sess = tf.Session()
sess = tf.Session()
>>>

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS