运行TensorFlow出现Your CPU supports instructions that this TensorFlow binary was not compiled to use: AV
原因:
import os #在顶头位置加上
os.environ["TF_CPP_MIN_LOG_LEVEL"]='1' # ‘1’表示默认的显示等级,运行时显示所有信息
os.environ["TF_CPP_MIN_LOG_LEVEL"]='2' # ‘2’运行时只显示 warning 和 Error
os.environ["TF_CPP_MIN_LOG_LEVEL"]='3' # ‘3’运行时只显示 Error
解决:头部加上:import os
然后在程序开头部分加上:os.environ["TF_CPP_MIN_LOG_LEVEL"]='2'
效果:
import os
os.environ["TF_CPP_MIN_LOG_LEVEL"]='2'
这样在执行Python的TensorFlow框架文件时就不会出现:Your CPU supports instructions that this TensorFlow binary was not compiled to use: AV