【发布时间】:2017-06-18 21:15:10
【问题描述】:
我按照主网站中的说明在 anaconda 中安装了 tensorflow。但是“import tensorflow”仅适用于 anaconda envs 中 tensorflow 文件夹中的 python。 anaconda的python3.6没有导入tensorflow。
【问题讨论】:
标签: tensorflow
我按照主网站中的说明在 anaconda 中安装了 tensorflow。但是“import tensorflow”仅适用于 anaconda envs 中 tensorflow 文件夹中的 python。 anaconda的python3.6没有导入tensorflow。
【问题讨论】:
标签: tensorflow
我也面临类似的挑战 以下方式对我有用
第一步:安装最新的anaconda
第 2 步: C:> conda create -n tensorflow python=3.5
虽然你的 anaconda python 是 3.6 tensorflow 可以在 3.5 上运行
第 3 步: C:> 激活张量流
(tensorflow)C:> # 你的提示应该改变
第四步:
4.1 : CPU 命令
(tensorflow)C:> pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.2.1-cp35-cp35m-win_amd64.whl
4.2 : GPU 命令
(tensorflow)C:> pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.2.1-cp35-cp35m-win_amd64.whl
第五步(验证安装tensorflow)
(启动新终端)
$ python
(enter the following command)
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))
the output should be
Hello, TensorFlow!
第六步: 打开 Anaconda 导航器 将应用程序从“Root 更改为 Tensorflow”通道(左上角)
第 7 步: 现在安装您希望使用的所需的 jupyter 或 spyder (安装后启动笔记本就可以了)
【讨论】:
执行安装步骤,但将 3.5 或 35 替换为 3.6 或 36。对我有用。
conda create -n tensorflow python=3.6
activate tensorflow
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.2.1-cp36-cp36m-win_amd64.whl
【讨论】: