导入tensorflow库,出现错误 The TensorFlow library wasn't compiled to use SSE instructions········

作为小白,刚入门开始使用tensorflow库,运行了一下下面的验证代码,发现结果是没错,但中间这堆警告是什么鬼?

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

导入tensorflow库,出现错误 The TensorFlow library wasn't compiled to use SSE instructions········_第1张图片

经过一些CSDN上大神的指点,发现只需在代码前再加上下面两句即可:

#前面加上下面两句
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))

运行出来直接没有报错,完美!

 

原创博客为:https://blog.csdn.net/qq_36306781/article/details/81254832

官网解释为:https://blog.csdn.net/hq86937375/article/details/79696023 

 

你可能感兴趣的:(导入tensorflow库,出现错误 The TensorFlow library wasn't compiled to use SSE instructions········)