美文网首页
安装Anaconda和TensorFlow

安装Anaconda和TensorFlow

作者: minlover | 来源:发表于2018-12-28 09:26 被阅读0次

看了一个教程

https://blog.csdn.net/hola_f/article/details/70482300

https://blog.csdn.net/u013080652/article/details/68922702

1、作者强烈建议安装4.2,用python3.5,说是调用TensorFlow 比较好。

Anaconda下载:https://repo.anaconda.com/archive/

安装过程中,Anaconda会提示是否添加到环境变量,选择“是”;(其实不用太看,基本上一直next到底就好了)

2、安装TensorFlow

有cpu和gpu两个版本,我安装的是cpu版本。

以管理员身份运行cmd 

进入到安装目录的Scripts中,打开命令行,输入:

pip install tensorflow

测试

因为电脑之前装了python 3.6, 又不想卸,所以直接在Anaconda安装目录下打开python35了。

import tensorflow as tf

hello = tf.constant('Hello, TensorFlow!')

sess = tf.Session()

print(sess.run(hello))

输出:Hello, TensorFlow!

a = tf.constant(10)

b = tf.constant(32)

print(sess.run(a + b))

输出:42

3、配置PyCharm

file->setting


【问题】

后来又一次安装时,报错已经安装过wrapt,无法卸载wrapt,导致tensorflow无法安装下去

解决方法:

pip install tensorflow --ignore-installed wrapt

相关文章

网友评论

      本文标题:安装Anaconda和TensorFlow

      本文链接:https://www.haomeiwen.com/subject/jfajlqtx.html