安装Tensorflow后的运行例子报错解决办法

安装好了Tensorflow,运行例子出现如下的错误:

import tensorflow as tf
hello = tf.constant('Hello ,TensorFlow')
sess = tf.Session()
print(sess.run(hello))


出现如下的错误:

 Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2


解决办法:

import os

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

import tensorflow as tf
hello = tf.constant('Hello ,TensorFlow')
sess = tf.Session()
print(sess.run(hello))


猜你喜欢

转载自blog.csdn.net/qq_38455576/article/details/79856905