我按照说明here在Windows 10 / Anaconda 3.5.x 64位环境中安装了tensorflow。当我执行hello world示例时,第一次尝试运行会话时会打印几个“未知的op”错误。所有后续运行都没问题。
我做错了吗?
(C:\Program Files\Anaconda3) C:\WINDOWS\system32>conda create -n tensorflow
Fetching package metadata ...........
Solving package specifications:
Package plan for installation in environment C:\Program Files\Anaconda3\envs\tensorflow:
Proceed ([y]/n)? y
#
# To activate this environment, use:
# > activate tensorflow
#
# To deactivate this environment, use:
# > deactivate tensorflow
#
# * for power-users using bash, you must source
#
(C:\Program Files\Anaconda3) C:\WINDOWS\system32>activate tensorflow
(tensorflow) C:\WINDOWS\system32>pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl
Collecting tensorflow==1.0.1 from https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl
Downloading https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl (14.7MB)
100% |################################| 14.7MB 60kB/s
Collecting numpy>=1.11.0 (from tensorflow==1.0.1)
Using cached numpy-1.12.0-cp35-none-win_amd64.whl
Collecting protobuf>=3.1.0 (from tensorflow==1.0.1)
Using cached protobuf-3.2.0-py2.py3-none-any.whl
Collecting wheel>=0.26 (from tensorflow==1.0.1)
Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
100% |################################| 71kB 1.3MB/s
Collecting six>=1.10.0 (from tensorflow==1.0.1)
Downloading six-1.10.0-py2.py3-none-any.whl
Collecting setuptools (from protobuf>=3.1.0->tensorflow==1.0.1)
Using cached setuptools-34.3.1-py2.py3-none-any.whl
Collecting packaging>=16.8 (from setuptools->protobuf>=3.1.0->tensorflow==1.0.1)
Using cached packaging-16.8-py2.py3-none-any.whl
Collecting appdirs>=1.4.0 (from setuptools->protobuf>=3.1.0->tensorflow==1.0.1)
Using cached appdirs-1.4.3-py2.py3-none-any.whl
Collecting pyparsing (from packaging>=16.8->setuptools->protobuf>=3.1.0->tensorflow==1.0.1)
Using cached pyparsing-2.2.0-py2.py3-none-any.whl
Installing collected packages: numpy, six, pyparsing, packaging, appdirs, setuptools, protobuf, wheel, tensorflow
Successfully installed appdirs-1.4.3 numpy-1.12.0 packaging-16.8 protobuf-3.2.0 pyparsing-2.2.0 setuptools-34.3.1 six-1.10.0 tensorflow-1.0.1 wheel-0.29.0
(tensorflow) C:\WINDOWS\system32>python
Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul 5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> hello = tf.constant("Hello, World!")
>>> sess = tf.Session()
>>> print(sess.run(hello))
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "BestSplits" device_type: "CPU"') for unknown op: BestSplits
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "CountExtremelyRandomStats" device_type: "CPU"') for unknown op: CountExtremelyRandomStats
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "FinishedNodes" device_type: "CPU"') for unknown op: FinishedNodes
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "GrowTree" device_type: "CPU"') for unknown op: GrowTree
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "ReinterpretStringToFloat" device_type: "CPU"') for unknown op: ReinterpretStringToFloat
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "SampleInputs" device_type: "CPU"') for unknown op: SampleInputs
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "ScatterAddNdim" device_type: "CPU"') for unknown op: ScatterAddNdim
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "TopNInsert" device_type: "CPU"') for unknown op: TopNInsert
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "TopNRemove" device_type: "CPU"') for unknown op: TopNRemove
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "TreePredictions" device_type: "CPU"') for unknown op: TreePredictions
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "UpdateFertileSlots" device_type: "CPU"') for unknown op: UpdateFertileSlots
b'Hello, World!'
>>> print(sess.run(hello))
b'Hello, World!'
>>> print(sess.run(hello))
b'Hello, World!'
>>> exit
Use exit() or Ctrl-Z plus Return to exit
>>> ^Z