本文介绍了Windows 上的 TensorFlow 版本 1.0.0-rc2:“OpKernel('op:“BestSplits" device_type:“CPU"'),用于未知操作:BestSplits"带测试代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I installed TensorFlow version 1.0.0-rc2 on Windows 7 SP1 x64 Ultimate (Python 3.5.2 |Anaconda custom (64-bit)) using:

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 或控制台中:

When I try running the test script from https://web.archive.org/web/20170214034751/https://www.tensorflow.org/get_started/os_setup#test_the_tensorflow_installation in Eclipse 4.5 or in the console:

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

我收到了一些错误消息:

I obtain some error message:

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):

I didn't have such issues with TensorFlow 0.12.1 (installed with pip install tensorflow==0.12.1):

TensorFlow version: 0.12.1
b'Hello, TensorFlow!'

推荐答案

安装 今天的每晚构建(CPU 版本):

Installing today's nightly build (CPU version):

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" 等).

fixed the issue (no more "OpKernel ('op: "BestSplits" device_type: "CPU"') for unknown op: BestSplits" etc.).

现在有一些 SSE 警告:

There are now some SSE warnings:

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.

在这种情况下,您可以尝试如何使用 SSE4.2 和 AVX 指令编译 Tensorflow?

in which case you can try How to compile Tensorflow with SSE4.2 and AVX instructions?

TensorFlow1.0.0 几天前发布.但是,它有同样的问题.最近的每晚构建有 不同的警告:

TensorFlow 1.0.0 was released a few days ago. However, it has the same issue. A more recent nightly build has 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 二进制文件,使用 SSE4.1、SSE4.2 和 AVX 优化编译.

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

To hide the warnings/errors, you can use os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3', e.g.:

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日志.
  • 0: all logs shown (that's the default setting)
  • 1: filter out INFO logs
  • 2: additionally filter out WARNING logs
  • 3: additionally filter out ERROR logs.

这篇关于Windows 上的 TensorFlow 版本 1.0.0-rc2:“OpKernel('op:“BestSplits" device_type:“CPU"'),用于未知操作:BestSplits"带测试代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 15:35