python怎么安装tensorflow-Python使用pip安装TensorFlow模块

1.首先确保已经安装python,然后用pip来安装matplotlib模块。

2.进入到cmd窗口下,建议执行python -m pip install -U pip setuptools进行升级。

3.如果之前已经安装了Numpy,则需要先卸载之前的安装,因为每个Tensorflow都有一个版本的numpy对应,故要卸载之前numpy

4.接着键入python -m pip install --upgrade tensorflow 进行自动的安装,系统会自动下载安装包。

命令提交以后,你唯一能做的就是等待了。你唯一能祈祷的,就是这该死的GFW不会坏了你好事。 还好这次运气不错,一次搞定。

验证安装

在桌面上创建a.py文件,写入以下代码

importtensorflow as tfimportos

os.environ["TF_CPP_MIN_LOG_LEVEL"]= "2"hello= tf.constant("Hello, TensorFlow!")

sess=tf.Session()print(sess.run(hello))

a= tf.constant(10)

b= tf.constant(25)print(sess.run(a + b))

参考:

win10安装TensorFlow填坑笔记:http://blog.csdn.net/chewinggum/article/details/70373098

【TensorFlow】Windows10 64 位下安装 TensorFlow - 官方原生支持:http://blog.csdn.net/u010099080/article/details/53418159

Windows下安装te

你可能感兴趣的:(python怎么安装tensorflow-Python使用pip安装TensorFlow模块)