【问题标题】:'tensorflow' installed but not run in Spider or Jupyter notebook'tensorflow' 已安装但未在 Spider 或 Jupyter 笔记本中运行
【发布时间】:2018-05-01 15:25:06
【问题描述】:

我已经通过 Anaconda 安装了 tensorflow,并通过以下方式成功验证了它

import tensorflow as tf

hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))

验证成功。

但是当我打开 Jupyter notebook 或 Spider 时,输入:

import tensorflow as ts

它出现了:

Traceback(最近一次调用最后一次):

文件“”,第 1 行,在 将张量流导入为 ts

ModuleNotFoundError: 没有名为“tensorflow”的模块

有什么建议吗?谢谢!

【问题讨论】:

    标签: tensorflow


    【解决方案1】:

    一种解决方案是在您的 Tensorflow 环境中安装 Spyder,以及通过 pip 安装库(numpy、pandas、matplotlib 等)。

    source activate tensorflow
    (tensorflow) conda install spyder  
    (tensorflow) pip install "libraries"
    

    与 Jupyter 相同。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-07-19
      • 1970-01-01
      • 1970-01-01
      • 2021-07-02
      • 1970-01-01
      • 2018-07-28
      相关资源
      最近更新 更多