美文网首页
TensorFlow学习中的第一个坑

TensorFlow学习中的第一个坑

作者: 豪哥的世界 | 来源:发表于2018-08-28 14:31 被阅读25次

安装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]

stackoverflow网站有比较好的答案
https://stackoverflow.com/questions/47068709/your-cpu-supports-instructions-that-this-tensorflow-binary-was-not-compiled-to-u

最简单办法就是忽略它,在代码的顶端加入下面的代码

# Just disables the warning, doesn't enable AVX/FMA
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'

相关文章

网友评论

      本文标题:TensorFlow学习中的第一个坑

      本文链接:https://www.haomeiwen.com/subject/kdofwftx.html