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

版权声明:博客为作者平时学习备忘,参考资料已在文尾列出一并表示感谢。如若转载,请列明出处。 https://blog.csdn.net/woai8339/article/details/83066589

今天从头开始学习深度学习时发现,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

猜你喜欢

转载自blog.csdn.net/woai8339/article/details/83066589