Win10中使用Anaconda安装Tensorflow-gpu

一、改成连接清华源镜像

  • 安装Tensorflow时,需要从Anaconda仓库中下载,一般默认链接的都是国外镜像地址,下载会很慢(跨国!),我直接下载失败了。这里用国内清华镜像,需要改一下链接镜像的地址,下面两行代码用来改成连接清华镜像的
  • 打开Anaconda中的 Anaconda Prompt,输入:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ 
  • 接着输入:
conda config --set show_channel_urls yes

二、Anaconda中安装Tensorflow-gpu

1、创建tensorflow环境:

  • 打开Anaconda Navigator:

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

  • 创建中:

在这里插入图片描述

  • 创建完成:
    在这里插入图片描述

2、安装Tensorflow-gpu

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

  • 等待一段时间后,安装完成:
    在这里插入图片描述

3、验证是否安装成功

进入tensorflow虚拟环境:

activate tensorflow

退出:

deactivate

进入python,输入以下命令,无报错即表示安装成功!

import tensorflow as tf
发布了28 篇原创文章 · 获赞 5 · 访问量 1855

猜你喜欢

转载自blog.csdn.net/elegantoo/article/details/104399561