Windows 上的 TensorFlow 版本 1.0.0-rc2:“OpKernel('op:“BestSplits”device_type:“CPU”')用于未知 op:BestSplits”带有测试代码
- 2025-04-10 09:45:00
- admin 原创
- 17
问题描述:
我在 Windows 7 SP1 x64 Ultimate(Python 3.5.2 |Anaconda 自定义(64 位))上安装了 TensorFlow 版本 1.0.0-rc2,使用以下命令:
pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.0rc2-cp35-cp35m-win_amd64.whl
当我尝试在 Eclipse 4.5 或控制台中从https://web.archive.org/web/20170214034751/https://www.tensorflow.org/get_started/os_setup#test_the_tensorflow_installation运行测试脚本时:
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: f_jenkinshomeworkspace
elease-windevicecpuoswindows ensorflob
wcorerameworkop_kernel.cc:943] OpKernel ('op: "BestSplits" device_type: "CPU"') for unknown op: BestSplits
E c: f_jenkinshomeworkspace
elease-windevicecpuoswindows ensorflowcorerameworkop_kernel.cc:943] OpKernel ('op: "CountExtremelyRandomStats" device_type: "CPU"') for unknown op: CountExtremelyRandomStats
E c: f_jenkinshomeworkspace
elease-windevicecpuoswindows ensorflowcorerameworkop_kernel.cc:943] OpKernel ('op: "FinishedNodes" device_type: "CPU"') for unknown op: FinishedNodes
E c: f_jenkinshomeworkspace
elease-windevicecpuoswindows ensorflowcorerameworkop_kernel.cc:943] OpKernel ('op: "GrowTree" device_type: "CPU"') for unknown op: GrowTree
E c: f_jenkinshomeworkspace
elease-windevicecpuoswindows ensorflowcorerameworkop_kernel.cc:943] OpKernel ('op: "ReinterpretStringToFloat" device_type: "CPU"') for unknown op: ReinterpretStringToFloat
E c: f_jenkinshomeworkspace
elease-windevicecpuoswindows ensorflowcorerameworkop_kernel.cc:943] OpKernel ('op: "SampleInputs" device_type: "CPU"') for unknown op: SampleInputs
E c: f_jenkinshomeworkspace
elease-windevicecpuoswindows ensorflowcorerameworkop_kernel.cc:943] OpKernel ('op: "ScatterAddNdim" device_type: "CPU"') for unknown op: ScatterAddNdim
E c: f_jenkinshomeworkspace
elease-windevicecpuoswindows ensorflowcorerameworkop_kernel.cc:943] OpKernel ('op: "TopNInsert" device_type: "CPU"') for unknown op: TopNInsert
E c: f_jenkinshomeworkspace
elease-windevicecpuoswindows ensorflowcorerameworkop_kernel.cc:943] OpKernel ('op: "TopNRemove" device_type: "CPU"') for unknown op: TopNRemove
E c: f_jenkinshomeworkspace
elease-windevicecpuoswindows ensorflowcorerameworkop_kernel.cc:943] OpKernel ('op: "TreePredictions" device_type: "CPU"') for unknown op: TreePredictions
E c: f_jenkinshomeworkspace
elease-windevicecpuoswindows ensorflowcorerameworkop_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!'
解决方案 1:
安装今天的夜间版本(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: f_jenkinshomeworkspace
ightly-windevicecpuoswindows ensorflowcoreplatformcpu_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: f_jenkinshomeworkspace
ightly-windevicecpuoswindows ensorflowcoreplatformcpu_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: f_jenkinshomeworkspace
ightly-windevicecpuoswindows ensorflowcoreplatformcpu_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: f_jenkinshomeworkspace
ightly-windevicecpuoswindows ensorflowcoreplatformcpu_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: f_jenkinshomeworkspace
ightly-windevicecpuoswindows ensorflowcoreplatformcpu_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: f_jenkinshomeworkspace
ightly-windevicecpuoswindows ensorflowcoreplatformcpu_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?
TensorFlow 1.0.0几天前发布了。但是,它有同样的问题。较新的夜间构建有不同的警告:
sess = tf.Session()
2017-02-17 13:01:59.790943: W c: f_jenkinshomeworkspace
ightly-windevicecpuoswindows ensorflowcoreplatformcpu_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'
,例如:
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
日志。
解决方案 2:
参考上述建议,我认为采取以下两个步骤很有帮助:
一、升级TensorFlow:
pip install --upgrade tensorflow==1.1.0rc1
然后,错误日志变为警告日志:
W c: f_jenkinshomeworkspace
elease-windevicecpuoswindows ensorflowcoreplatformcpu_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.
第二,您可能能够抑制 2 级警告过滤器。
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
我认为无需过滤“错误”日志它就能很好地运行。
解决方案 3:
您可能能够抑制级别 2 的警告过滤器。对于我在 virtualenv 安装中安装的 TensorFlow 1.0.1,此方法有效。
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
抱歉,我想补充一下答案,但是我不值得评论。
解决方案 4:
该问题似乎已在 1.1.0rc0 及更高版本中修复。
查找 tensorflow 的最新版本:
pip search --version tensorflow
升级 TensorFlow:
pip install --upgrade tensorflow==1.1.0rc1
扫码咨询,免费领取项目管理大礼包!