Win 7 + spyder + Tensorflow
windows下安装Tensorflow搞定,最终使用spyder调用tensorflow ,记录一下
Anaconda是一种拥有各种Python库的集成环境,也支持Windows、Mac和Linux系统。
安装 TensorFlow
打开 Anaconda Prompt,建立名为 tensorflow的 conda计算环境,输入:
conda create -n tensorflow python=3.5
安装完以后,激活 tensorflow 环境,输入:
activate tensorflow
激活后,我选择安装的是 CPU版本,输入:
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0-cp35-cp35m-win_amd64.whl
测试
python
import tensorflow as tf
hello = tf.constant('Hello, Tensorflow!')
sess = tf.Session()
print(sess.run(hello))
a = tf.constant(10)
b = tf.constant(22)
print(sess.run(a+b))

spyder
由于官网下载 Anaconda,默认自带python3.6;而TensorFlow当前对python的支持仅对3.5版本比较友好。所以需要看一下自己的spyder安装版本,我这个恰好是3.5.所以直接调用

转载:https://www.cnblogs.com/AriesQt/p/6772902.html

浙公网安备 33010602011771号