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

如果你运行TensorFlow出现了以下提示

2018-05-02 13:58:36.608794: I T:\src\github\tensorflow\tensorflow\core\platform\cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2018-05-02 13:58:36.845308: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1356] Found device 0 with properties:
name: GeForce GTX 660 major: 3 minor: 0 memoryClockRate(GHz): 1.0975
pciBusID: 0000:01:00.0
totalMemory: 2.00GiB freeMemory: 1.65GiB
2018-05-02 13:58:36.851020: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1435] Adding visible gpu devices: 0
2018-05-02 13:58:37.134451: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:923] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-05-02 13:58:37.136802: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:929]      0
2018-05-02 13:58:37.138778: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:942] 0:   N
2018-05-02 13:58:37.140556: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1053] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 681 MB memory) -> physical GPU (device: 0, name: GeForce GTX 660, pci bus id: 0000:01:00.0, compute capability: 3.0)

别慌,这不是错误,但是如何除去这个提示呢?

我们设置一下log等级就可以解决这个问题,在文件的顶部加上

import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='3'

Post Comment