win7+Keras使用Tensorflow作为后端的安装教程gpu版小白推荐

win7+Keras使用Tensorflow作为后端的安装教程gpu版小白推荐

首先附上成功截图

欢迎大家评论,若碰到了问题,可以直接评论,看到了会立刻回复
在这里插入图片描述

一、系统情况

系统:windows7
gpu:quadro p620
工具:cuda9.0+cudnn9.0+vs2015+Anaconda3.5.0.1

二、安装工具准备

显卡驱动+cuda9.0+cudnn9.0+vs2015+Anaconda3.5.0.1
cuda安装教程见该链接(若已安装请跳过该步骤):https://blog.csdn.net/u011609063/article/details/84887674
Anaconda3安装:https://blog.csdn.net/u011609063/article/details/84888121

三、tensorflow-gpu安装

第一步:打开命令行
配置清华镜像:conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
显示url:conda config --set show_channel_urls yes
创建一个名为python35,python版本为3.5.x的运行环境:conda create -n python3.5 python=3.5
在这里插入图片描述
输入y即可
创建完成后通过conda activate python35激活运行环境,通过python -V查看是否正确激活该环境
在这里插入图片描述
第一种:需要首先输入deactivate退出当前环境,然后可以使用conda install -n python35 tensorflow-gpu
第二种:升级pip:python -m pip install --upgrade pip
通过pip list 查看是否正确安装,该版本为18.x.x
若正确则输入pip install --ignore-installed --upgrade tensorflow-gpu,否则使用pip3
验证结果:

在命令行中输入python
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))	
最后会输出Hello, TensorFlow!

参考1:https://blog.csdn.net/weixin_39290638/article/details/80045236
参考2:https://www.leiphone.com/news/201711/GCh0IBszXrxP1iHU.html
参考3:Keras官方搭建网站https://keras-cn.readthedocs.io/en/latest/for_beginners/keras_windows/#_3
其余参考已经展示在链接中,写文章不易,转载请注明原出处

猜你喜欢

转载自blog.csdn.net/u011609063/article/details/84188942