Tensorflow 运行警告提示 Your CPU supports instructions that this TensorFlow binary was not compiled to use

由于现在神经网络这个东西比较火,准确的说是深度学习这个东西比较火,我们实验室准备靠这个东西发几个CCF A类的文章,虽然我不太懂这东西,兴趣也一般都是毕竟要跟随主流的,于是今天安装起了 Tensorflow 这个深度学习的框架。

安装好以后运行一个Demo ,如下:

import tensorflow as tf
a=tf.constant(2)
b=tf.constant(20)

with tf.Session() as sess:
    print(sess.run(a*b))

运行结果如下:

2018-05-03 19:57:44.151803: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
2018-05-03 19:57:44.251905: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:892] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2018-05-03 19:57:44.252195: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1030] Found device 0 with properties:
name: GeForce GTX 1050 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.62
pciBusID: 0000:01:00.0
totalMemory: 3.95GiB freeMemory: 3.65GiB
2018-05-03 19:57:44.252228: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1120] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
40

这么一堆东西,一块就知道是没有啥用的警告,当然这是要把那个结果排除的,本打算忽略,不过这么一条警告我觉得我还是应该研究一下,如下:

Your CPU supports instructions that this TensorFlow binary was not compiled to use

这个警告是说我这个Tensorflow 不能支持几种CPU矢量运算的指令码,这东西看起来虽然是然并卵,但是总之是要人看着不太舒服,于是我上网找了找解法,发现大部分人是把警告直接屏蔽,方法如下:

1.

开头输入如下:

    import os

    os.environ[‘TF_CPP_MIN_LOG_LEVEL‘] = ‘2‘

不过这个法子总是有些不完美,于是继续研究,得到第二个法子:

2. 进 tensorflow 官网,从源码安装

这个法子十分彻底,不过难度太大,这里不进行考虑。

3.   第三个方法,可能是我找到的比较靠谱的一个法子:

参考:https://blog.csdn.net/PJ7410/article/details/78886048

这里面说这个东西是要使你的Tensorflow 支持 SSE4.1 SSE4.2 AVX AVX2 FMA 指令,并给出了一个外国网址:

TensorFlow binaries supporting AVX, FMA, SSE etc.

由于我的个人电脑的配置,我选择下面的安装包:

下载到电脑上后,执行:

sudo pip install --ignore-installed --upgrade  tensorflow-1.6.0-cp27-cp27mu-linux_x86_64.whl

然后就是漫长的等待,此时此刻我也是等待中呀,稍后便知是否可行。

原文地址:https://www.cnblogs.com/devilmaycry812839668/p/8987223.html

时间: 2024-07-30 14:04:12

Tensorflow 运行警告提示 Your CPU supports instructions that this TensorFlow binary was not compiled to use的相关文章

Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA

使用tensorflow时,提示 Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 去掉这个提示信息方法为修改~/.bashrc文件,最后加上一句 export TF_CPP_MIN_LOG_LEVEL=2 执行 source ~/.bashrc 即可 原文地址:https://www.cnblogs.com/liqinggui/p/9533170.html

解决tensorflow问题:Your CPU supports instructions that this TensorFlow binary was not compiled to use:

我不知道大家是不是和我一样是用pip install tensorflow安装的tensorflow库,但是使用的时候,却会显示: Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2 虽然运行起来没什么问题,但是看着总是不舒服.网上查阅了其他大神的博客之后,终于知道怎么处理了. 首先,卸载原有的Tensorflow 包: pip unistall tensorfl

报错解决——Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2

在导入tensorflow后,进行运算时,出现了报错Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2 解决方法:在最顶行写入以下代码即可 import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' 参考资料:Advanced Vector Extensions import os os.environ["TF_CPP_M

安装tensorflow遇到:Your CPU supports instructions that this TensorFlow binary was not compiled to use

为了提升CPU计算速度的.若你有支持cuda的GPU,则可以忽略这个问题,因为安装SSE4.1, SSE4.2, AVX, AVX2, FMA, 仅仅提升CPU的运算速度(大概有3倍). 解决方法: 忽视警告,并屏蔽警告 开头输入如下: import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' 2.进 tensorflow 官网,从源码安装. 原文地址:https://www.cnblogs.com/theWinter/p/8244685.html

TensorFlow忽略警告信息:FutureWarning

最近执行Tensorflow程序出现如下警告信息 D:\python36\lib\site-packages\tensorflow\python\framework\dtypes.py:493: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(

TensorFlow——分布式的TensorFlow运行环境

当我们在大型的数据集上面进行深度学习的训练时,往往需要大量的运行资源,而且还要花费大量时间才能完成训练. 1.分布式TensorFlow的角色与原理 在分布式的TensorFlow中的角色分配如下: PS:作为分布式训练的服务端,等待各个终端(supervisors)来连接. worker:在TensorFlow的代码注释中被称为终端(supervisors),作为分布式训练的计算资源终端. chief supervisors:在众多的运算终端中必须选择一个作为主要的运算终端.该终端在运算终端中

TensorFlow 从入门到精通(七):TensorFlow 运行原理

通过几个例程,我们逐渐对 TensorFlow 建立了感性认识.本文将进一步从内在原理进行深入理解,进而为阅读源码打好基础. 1. 图(Graph) TensorFlow 计算被抽象为包括若干节点的有向图.如下图所示例子: 对应的 TensorFlow Python 代码如下: import tensorflow as tf b = tf.Variable(tf.zeros([100])) # 100-d vector, init to zeroes W = tf.Variable(tf.ran

Tensorflow运行程序报错 FailedPreconditionError

1 FailedPreconditionError错误现象 在运行tensorflow时出现报错,报错语句如下: FailedPreconditionError (see above for traceback): Attempting to use uninitialized value Variable [[Node: Variable/read = _MklIdentity[T=DT_FLOAT, _kernel="MklOp", _device="/job:local

用Anko和Kotlin实现Android上的对话框和警告提示(KAD 24)

作者:Antonio Leiva 时间:Mar 9, 2017 原文链接:https://antonioleiva.com/dialogs-android-anko-kotlin/ 借助Builder,在Android创建警告提示和对话框相对来说是件简单的事,但是由于语言繁杂,有些提示通常就变得十分含糊. 在Kotlin中,仅Lambda表达式,可以帮助我们理解一点代码是怎样处理的. 但是,有了Anko,我们能够这一切都更加简单,在这篇文章中我们看到是怎么回事. 在Kotlin用Anko做警告提