Tensorflow的安装问题

戴维·希尔伯特

我安装了Tensorflow,到目前为止效果很好。但是,当我执行代码时,它将显示以下内容

2017-05-07 12:35:10.449884: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-05-07 12:35:10.449909: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-05-07 12:35:10.449919: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-05-07 12:35:10.449927: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2017-05-07 12:35:10.449934: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.

我尝试了许多不同的解决方案,但是没有用。bazel解决方案,但我认为我不使用此应用程序。我该如何解决这个问题?


┌─╼ [~]
└────╼ python3 test.py
2017-05-07 13:23:04.148596: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-05-07 13:23:04.148624: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-05-07 13:23:04.148629: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-05-07 13:23:04.148633: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2017-05-07 13:23:04.148637: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
Tensor("add:0", shape=(), dtype=int32)
5
┌─╼ [~]
└────╼ export TF_CPP_MIN_LOG_LEVEL=3
┌─╼ [~]
└────╼ python3 test.py
Tensor("add:0", shape=(), dtype=int32)
5

但是,如果我关闭终端然后再次打开它,我会得到同样的错误。怎样才能使伟大的解决方案export TF_CPP_MIN_LOG_LEVEL=3永久化?

提前致谢!

弗兰克·德农库特

一个类似的问题已经在堆栈溢出中发布您可以忽略这些警告。如果它们使您烦恼,则可以使用来掩盖它们os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3',例如:

import tensorflow as tf
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
print('TensorFlow version: {0}'.format(tf.__version__))
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章