python - Windows 上的 TensorFlow 版本 1.0.0-rc2 : "OpKernel (' op: "BestSplits" device_type: "CPU"') for unknown op: BestSplits"with test code

标签 python tensorflow

我在 Windows 7 SP1 x64 Ultimate (Python 3.5.2 |Anaconda custom (64-bit)) 上安装了 TensorFlow 版本 1.0.0-rc2,使用:

pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.0rc2-cp35-cp35m-win_amd64.whl

当我尝试从 https://web.archive.org/web/20170214034751/https://www.tensorflow.org/get_started/os_setup#test_the_tensorflow_installation 运行测试脚本时在 Eclipse 4.5 或控制台中:

import tensorflow as tf
print('TensorFlow version: {0}'.format(tf.__version__))
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))

我收到一些错误消息:

TensorFlow version: 1.0.0-rc2
'Hello, TensorFlow!'
E c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflob
w\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

为什么?

我在使用 TensorFlow 0.12.1(使用 pip install tensorflow==0.12.1 安装)时没有遇到此类问题:

TensorFlow version: 0.12.1
b'Hello, TensorFlow!'

最佳答案

安装 today's nightly build (CPU版本):

pip install --upgrade http://ci.tensorflow.org/view/Nightly/job/nightly-win/85/DEVICE=cpu,OS=windows/artifact/cmake_build/tf_python/dist/tensorflow-1.0.0rc2-cp35-cp35m-win_amd64.whl

修复了问题(不再有 “OpKernel ('op: ”BestSplits“device_type: ”CPU“') for unknown op: BestSplits” 等)。

现在有一些 SSE 警告:

TensorFlow version: 1.0.0-rc2
b'Hello, TensorFlow!'
2017-02-15 19:56:22.688266: W c:\tf_jenkins\home\workspace\nightly-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE instructions, but these are available on your machine and could speed up CPU computations.
2017-02-15 19:56:22.688266: W c:\tf_jenkins\home\workspace\nightly-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE2 instructions, but these are available on your machine and could speed up CPU computations.
2017-02-15 19:56:22.689266: W c:\tf_jenkins\home\workspace\nightly-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
2017-02-15 19:56:22.689266: W c:\tf_jenkins\home\workspace\nightly-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-02-15 19:56:22.689266: W c:\tf_jenkins\home\workspace\nightly-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-02-15 19:56:22.689266: W c:\tf_jenkins\home\workspace\nightly-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.

这种情况你可以试试How to compile Tensorflow with SSE4.2 and AVX instructions?


TensorFlow 1.0.0几天前发布了。但是,它有同样的问题。更新的夜间版本具有 different warnings :

sess = tf.Session()
2017-02-17 13:01:59.790943: W c:\tf_jenkins\home\workspace\nightly-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE instructions, but these are available on your machine and could speed up CPU computations.

仅供引用:Tensorflow macOS binary, compiled with SSE4.1, SSE4.2 and AVX optimizations.


要隐藏警告/错误,您可以use os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3',例如:

import tensorflow as tf
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
print('TensorFlow version: {0}'.format(tf.__version__))
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))

TF_CPP_MIN_LOG_LEVEL:

  • 0:显示所有日志(这是默认设置)
  • 1:过滤掉INFO日志
  • 2:额外过滤掉WARNING日志
  • 3:额外过滤掉ERROR日志。

关于python - Windows 上的 TensorFlow 版本 1.0.0-rc2 : "OpKernel (' op: "BestSplits" device_type: "CPU"') for unknown op: BestSplits"with test code,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42217532/

相关文章:

Python: "dynamic"列表的所有可能组合

python - 获取 Pandas DataFrame 中行之间的差异值

python - cmap.set_bad() 对 pcolor() 没有任何影响

python - 第一次和第二次执行的程序运行方式不同。为什么?

python - InvalidArgumentError : Cannot add tensor to the batch: number of elements does not match. 形状为 : [tensor]: [4], [batch]: [5] [Op:IteratorGetNext]

python - 在 Python 中堆叠多维数组的数组

Python:去除图像中水平黑线的快速方法

python - 为什么自定义读取操作仅适用于 test_session

python - 批量归一化导致训练和推理损失之间存在巨大差异

tensorflow - 如何在tensorflow(python)中调用opencv函数?