win11+3050ti创建tensorflow2.6-gpu环境和pytorch-gpu环境

1. 版本选择

 tensorflow官网各gpu版本与对应cuda、cudnn版本

从源代码构建  |  TensorFlow

可以看到tf2.6推荐cuda11.2版本

2.cuda安装

CUDA Toolkit Archive | NVIDIA Developer

 

3. cudnn安装

下载对应版本的cudnn

NVIDIA cuDNN | NVIDIA Developer

解压缩,将所有文件复制到cuda的安装路径中,通常为C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.5

4.tf 2.6-gpu安装

pip install tensorflow-gpu==2.6.0

5.环境配置

tensorflow官网给出的建议如下:

6.tf-gpu测试

import tensorflow as tf
print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))

 得到以下结果,则配置成功

Num GPUs Available:  1

7.pytorch-gpu安装

Start Locally | PyTorch

由于安装了cuda11.2,受版本限制只能安装cuda10.2对应的pytorch gpu版本

conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值