运行python文件报错:Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
运行python文件遇到报错:Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
这个报错并不影响到代码的运行,介绍一种简单的处理办法,在文件最上面添加以下代码段:
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
注意的是,应把这两行放在 import tensorflow as tf之前,否则还会报错。