1. 程式人生 > >tensorflow-Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX A

tensorflow-Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX A

今天從頭開始學習深度學習時發現,Hello World出現錯誤。報:2018-10-15 23:27:11.665115: I C:\tf_jenkins\workspace\rel-win\M\windows\PY\36\tensorflow\core\platform\cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2。CPU被鄙視了。。。。。
新增兩行程式碼import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'

。將其禁了

>>> import tensorflow as tf
>>> hello_constant = tf.constant('Hello World!')
>>> with tf.Session() as sess:
...     sess.run(hello_constant)
...
2018-10-15 23:27:11.665115: I C:\tf_jenkins\workspace\rel-win\M\windows\PY\36\tensorflow\core\platform\cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
b'Hello World!'
>>> import os
>>> os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
>>> with tf.Session() as sess:
...     sess.run(hello_constant)
...
b'Hello World!'

Ref:
1、https://blog.csdn.net/hq86937375/article/details/79696023?utm_source=blogxgwz1