PyTorch1.8-gpu和TensorFlow-gpu-2.5已发布【附下载地址和安装教程】

TensorFlow-gpu 2.5已发布,但官方网页还没有通知。
该版本已由google开发人员Mihai Maruseac发布在pypi网站
在这里插入图片描述

不过已经上线,查看地址链接:
地址一:
https://libraries.io/pypi/tf-nightly-gpu

地址二:
https://pypi.org/project/tf-nightly-cpu/

如果不想直接下载那就选择阿里云镜像源安装即可,安装之前请检查自己的cuda,nvidia,cudnn版本匹配情况,这里就不做介绍:可以参考我的博客文章:

(ubuntu版本)快速下载NVIDIA最新显卡驱动RTX3080ti、GTX1650ti、CUDA11.2,CUDNN的地址

赶快收藏:快速安装PyTorch和TensorFlow(gpu+cpu+1.7.1+2.2.0)命令

【长篇博文】Docker学习笔记(四):镜像的分层、打包、双向绑定、导入导出、Dockerfile的构建、部署与发布

【长篇博文】Docker学习笔记与深度学习环境的搭建和部署(二)

安装命令:

pip install tf-nightly-gpu==2.5.0 -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

测试是否安装成功:
安装完成后,进入Python环境,验证是否安装成功:
代码如下:

import tensorflow as tf
print(tf.__version__,tf.test.is_gpu_available())

如果就是True说明安装成功,gpu已经可以使用。
下载离线whl文件:http://mirrors.aliyun.com/pypi/simple/tensorflow-gpu/

这里附加windows10下的torch和TensorFlow的gpu使用教程:

当前驱动与cuda信息:

在这里插入图片描述在这里插入图片描述
pytorch下载地址:https://download.pytorch.org/whl/torch_stable.html
下载后自行安装:
在这里插入图片描述
验证torch-gpu是否可用:测试代码

import torch
flag = torch.cuda.is_available()
print(torch.__version__,flag)

ngpu= 1
# Decide which device we want to run on
device = torch.device("cuda:0" if (torch.cuda.is_available() and ngpu > 0) else "cpu")
print(device)
print(torch.cuda.get_device_name(0))
print(torch.rand(3,3).cuda())

运行结果:
在这里插入图片描述
TensorFlow:

pip install tf-nightly-gpu -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

测试代码同上,测试结果为

在这里插入图片描述
google官网安装TF-gpu参考:
https://colab.research.google.com/tf-nightly
在这里插入图片描述

阿里云下载TF-gpu轮子whl文件:
http://mirrors.aliyun.com/pypi/simple/tensorflow-gpu/
在这里插入图片描述
TF官网gpu与cuda匹配版本参考:
https://tensorflow.google.cn/install/source

参考文献:
https://pip.pypa.io/en/stable/reference/pip_install/#hash-checking-mode
https://blog.csdn.net/scp_6453/article/details/110715974

pytorch版本与cuda版本参考:https://blog.csdn.net/weixin_41194129/article/details/113394203

其他参考:https://www.cnblogs.com/
安装cuda和cudnn:搜索安装方式

conda search cudatoolkit
conda install cudatoolkit=?
conda search cudnn
conda install cudnn=
  • 2
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

源代码杀手

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值