Anaconda3 + Tensorflow 权威安装指南,亲测无数遍

https://repo.continuum.io/archive/

 

 

下载对应的Anaconda3版本

Anaconda3-5.0.0-Windows-x86_64

 

 

安装过程

https://jingyan.baidu.com/article/6f2f55a16d80f9b5b93e6cf4.html

 

创建新环境:

 

Python选择版本3.6

 

要安装的三个软件

 

 

安装好后可以在cmd中验证

1、activate tensorflow

 

2、python

 

3、

import tensorflow as tf

sess = tf.Session()

a = tf.constant(1)

b = tf.constant(2)

print(sess.run(a+b))

 

 

 

>>> import tensorflow as tf

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

>>> sess = tf.Session()

>>> sess.run(hello)

'Hello, TensorFlow!'

 

 

>>> a = tf.constant(10)

>>> b = tf.constant(32)

>>> sess.run(a + b)

42

>>> sess.close()

 

4、输出3

 

 

 

 

 

遇到的一些问题:

Pip 安装软件总是超时,修改网络连接时间pip --default-timeout=1000 install -U pip

参考:https://www.cnblogs.com/qq952693358/p/7784581.html

 

升级pip到最新版本:python -m pip install --upgrade pip

参考连接:https://blog.csdn.net/bon_mot/article/details/72770990

 

失败的情况下,我尝试直接输入 pip install Tensorflow,报错说setuptool版本为40,需要降级到39

参考连接:https://www.jianshu.com/p/2bd9c42c4027

 

 

报错Failed to load the native TensorFlow,安装了两个windows插件,不知道有没有用

参考连接:https://www.jianshu.com/p/4115338fba2d

 

 

Pycharm

 

猜你喜欢

转载自blog.csdn.net/yangwohenmai1/article/details/83148439