tensorflow2环境搭建

前言
tensorflow 由google发布开源的机器学习框架,2.x 是在1.x上基础上简化,重点关注易用性,同时兼具可扩展性和高性能,降低了机器学习的门槛。

1:环境
win10
Anaconda3-2022.05-Windows-x86_64 下载地址 https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/?C=M&O=D
或 https://repo.anaconda.com/archive/
pycharm-community-2022.2.3 下载地址:自行下载
推荐教程地址:https://tf.wiki/zh_hans/foreword.html

2:搭建
在这里插入图片描述

1> 创建环境
安装 Anaconda3 并将anaconda添加至环境变量
在这里插入图片描述
创建虚拟环境: 参考:https://tensorflow.google.cn/install/source_windows#gpu
在这里插入图片描述

conda create -n tf2 python==3.9.12
或 conda create --prefix=D:/tensorflow/tf2 python=3.9.12 (指定位置,这样更好)
*****显卡驱动版本一定要大于等于cuda版本
****在桌面上右键——NVIDIA控制面板——帮助——系统信息

激活环境:activate tf2 或 activate D:/tensorflow/tf2
在这里插入图片描述
以txt形式打开"C:\Users(你的用户名).condarc"文件,将内部文本替换为以下文本
替换为清华源或其他源

channels:
  - defaults
show_channel_urls: true
default_channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

安装GPU版本
conda install tensorflow-gpu2.6.0 或
pip install tensorflow-gpu
2.6.0

查看安装是否成功
conda list tensorflow
在这里插入图片描述

安装 pycharm-community
配置环境
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值