win10 安装 tensorflow-gpu 2.10.0

win10 安装 tensorflow-gpu 2.10.0

加群(AI学习交流群):
请添加图片描述

系统配置

系统 win10 x64
显卡 GTX 1660 Ti
CUDA 12.2
cudnn 8.9

查看版本对应:

https://tensorflow.google.cn/install/source_windows#gpu

VersionPython versionCompilerBuild toolscuDNNCUDA
tensorflow_gpu-2.10.03.7-3.10MSVC 2019Bazel 5.1.18.111.2

这里查看我系统配置 我安装 python 3.10 和 tensorflow_gpu-2.10.0

安装 conda

安装cuda

安装python3.10

conda create -p D:\tensorEnv python=3.10

激活虚拟环境

conda activate  D:\tensorEnv

安装cuda

这里根据自己的版本安装,按照表格推荐 11.2 ,我这里是12.2

conda install cudatoolkit=12.2

安装cudnn

这里根据自己的版本安装,按照表格推荐 8.1 ,我这里是 8.9

conda install cudnn=8.9

安装tensorflow的GPU版本

这里根据自己的版本安装,按照表格推荐tensorflow-gpu==2.10.0

(D:\tensorEnv)  C:\Users\mingxingwang> python -m pip install tensorflow-gpu==2.10.0

测试 test-gpu.py

import tensorflow as tf

# print(tf.test.is_gpu_available())
print(tf.config.list_physical_devices('GPU'))
(D:\tensorEnv)  C:\Users\mingxingwang> python  test-gpu.py 

输出

[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]

参考:
适用于Microsoft窗口的 CUDA 安装指南 https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/

cuDNN Archive https://developer.nvidia.com/rdp/cudnn-archive

Build a TensorFlow pip package from source and install it on Windows https://tensorflow.google.cn/install/source_windows#gpu

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值