0
点赞
收藏
分享

微信扫一扫

Tensorflow 运行警告提示 Your CPU supports instructions that this TensorFlow

由于现在神经网络这个东西比较火,准确的说是深度学习这个东西比较火,我们实验室准备靠这个东西发几个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.   第三个方法,可能是我找到的比较靠谱的一个法子:

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

​​TensorFlow binaries supporting AVX, FMA, SSE etc.​​

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

Tensorflow 运行警告提示     Your CPU supports instructions that this TensorFlow_深度学习


下载到电脑上后,执行:

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

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

经过漫长的等待,大致花了一个小时左右的时间,终于搞定,所有的警告消息都没有了,此法可行。

搞定

举报

相关推荐

0 条评论