1. 程式人生 > 其它 >成功解決Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2

成功解決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

https://blog.csdn.net/zqx951102/article/details/88897117

解決辦法

在最頂行寫入

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

此方法,可以臨時遮蔽警告資訊,看起來舒服了一些。如果網友們,有更好的解決辦法,群策群力,請留言探討,共同學習!

程式碼如下:

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

import tensorflow as tf
sess=tf.Session()
a=tf.constant(1)
b=tf.constant(3)
print(sess.run(a+b))