首页 文章

无法在Conda环境ubuntu 16.04 python 3.6.4中导入tensorflow

提问于
浏览
0

我是tensorflow的新手 . 我通过以下步骤安装了tensorflow:

$康达创建-n tensorflow PIP蟒= 3.6 $源激活tensorflow(tensorflow)$ PIP安装安装--ignore --upgrade \ https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.8 . 0-cp36-cp36m-linux_x86_64.whl(仅限CPU)

但是当我尝试运行以下程序时:

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

我在 spyder 中收到此错误:

ModuleNotFoundError:没有名为'tensorflow'的模块

python 终端我收到了这个错误:

2018年5月16日13:54:34.054511:我tensorflow /核心/平台/ cpu_feature_guard.cc:140]你的CPU支持的指令,这TensorFlow二进制编译时不使用:SSE4.1 SSE4.2 AVX AVX2 FMA .

任何人都可以告诉我可能的原因是什么?

1 回答

  • 0

    在python终端是正常的警告 . 它告诉您,您的tensorflow安装不是通过其他优化来源编译的 . 但大多数用户都没有这种优化 .

    spyder中的错误:您必须设置程序才能使用"tensorflow"环境 . 这里有很好的解释:How to run Spyder in virtual environment? .

相关问题