Windows 上的 TensorFlow 版本 1.0.0-rc2:“OpKernel('op:“BestSplits”device_type:“CPU”')用于未知 op:BestSplits”带有测试代码

2025-04-10 09:45:00
admin
原创
52
摘要:问题描述:我在 Windows 7 SP1 x64 Ultimate(Python 3.5.2 |Anaconda 自定义(64 位))上安装了 TensorFlow 版本 1.0.0-rc2,使用以下命令:pip install --upgrade https://storage.googleapis.co...

问题描述:

我在 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
wcorerameworkop_kernel.cc:943] OpKernel ('op: "BestSplits" device_type: "CPU"') for unknown op: BestSplits
E c:    f_jenkinshomeworkspace
elease-windevicecpuoswindows    ensorflowcorerameworkop_kernel.cc:943] OpKernel ('op: "CountExtremelyRandomStats" device_type: "CPU"') for unknown op: CountExtremelyRandomStats
E c:    f_jenkinshomeworkspace
elease-windevicecpuoswindows    ensorflowcorerameworkop_kernel.cc:943] OpKernel ('op: "FinishedNodes" device_type: "CPU"') for unknown op: FinishedNodes
E c:    f_jenkinshomeworkspace
elease-windevicecpuoswindows    ensorflowcorerameworkop_kernel.cc:943] OpKernel ('op: "GrowTree" device_type: "CPU"') for unknown op: GrowTree
E c:    f_jenkinshomeworkspace
elease-windevicecpuoswindows    ensorflowcorerameworkop_kernel.cc:943] OpKernel ('op: "ReinterpretStringToFloat" device_type: "CPU"') for unknown op: ReinterpretStringToFloat
E c:    f_jenkinshomeworkspace
elease-windevicecpuoswindows    ensorflowcorerameworkop_kernel.cc:943] OpKernel ('op: "SampleInputs" device_type: "CPU"') for unknown op: SampleInputs
E c:    f_jenkinshomeworkspace
elease-windevicecpuoswindows    ensorflowcorerameworkop_kernel.cc:943] OpKernel ('op: "ScatterAddNdim" device_type: "CPU"') for unknown op: ScatterAddNdim
E c:    f_jenkinshomeworkspace
elease-windevicecpuoswindows    ensorflowcorerameworkop_kernel.cc:943] OpKernel ('op: "TopNInsert" device_type: "CPU"') for unknown op: TopNInsert
E c:    f_jenkinshomeworkspace
elease-windevicecpuoswindows    ensorflowcorerameworkop_kernel.cc:943] OpKernel ('op: "TopNRemove" device_type: "CPU"') for unknown op: TopNRemove
E c:    f_jenkinshomeworkspace
elease-windevicecpuoswindows    ensorflowcorerameworkop_kernel.cc:943] OpKernel ('op: "TreePredictions" device_type: "CPU"') for unknown op: TreePredictions
E c:    f_jenkinshomeworkspace
elease-windevicecpuoswindows    ensorflowcorerameworkop_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
相关推荐
  政府信创国产化的10大政策解读一、信创国产化的背景与意义信创国产化,即信息技术应用创新国产化,是当前中国信息技术领域的一个重要发展方向。其核心在于通过自主研发和创新,实现信息技术应用的自主可控,减少对外部技术的依赖,并规避潜在的技术制裁和风险。随着全球信息技术竞争的加剧,以及某些国家对中国在科技领域的打压,信创国产化显...
工程项目管理   3949  
  为什么项目管理通常仍然耗时且低效?您是否还在反复更新电子表格、淹没在便利贴中并参加每周更新会议?这确实是耗费时间和精力。借助软件工具的帮助,您可以一目了然地全面了解您的项目。如今,国内外有足够多优秀的项目管理软件可以帮助您掌控每个项目。什么是项目管理软件?项目管理软件是广泛行业用于项目规划、资源分配和调度的软件。它使项...
项目管理软件   2735  
  本文介绍了以下10款项目管理软件工具:禅道项目管理软件、Freshdesk、ClickUp、nTask、Hubstaff、Plutio、Productive、Targa、Bonsai、Wrike。在当今快速变化的商业环境中,项目管理已成为企业成功的关键因素之一。然而,许多企业在项目管理过程中面临着诸多痛点,如任务分配不...
项目管理系统   74  
  本文介绍了以下10款项目管理软件工具:禅道项目管理软件、Monday、TeamGantt、Filestage、Chanty、Visor、Smartsheet、Productive、Quire、Planview。在当今快速变化的商业环境中,项目管理已成为企业成功的关键因素之一。然而,许多项目经理和团队在管理复杂项目时,常...
开源项目管理工具   82  
  本文介绍了以下10款项目管理软件工具:禅道项目管理软件、Smartsheet、GanttPRO、Backlog、Visor、ResourceGuru、Productive、Xebrio、Hive、Quire。在当今快节奏的商业环境中,项目管理已成为企业成功的关键因素之一。然而,许多企业在选择项目管理工具时常常面临困惑:...
项目管理系统   68  
热门文章
项目管理软件有哪些?
曾咪二维码

扫码咨询,免费领取项目管理大礼包!

云禅道AD
禅道项目管理软件

云端的项目管理软件

尊享禅道项目软件收费版功能

无需维护,随时随地协同办公

内置subversion和git源码管理

每天备份,随时转为私有部署

免费试用