栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

Pytorch1.7适配cuda篇

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Pytorch1.7适配cuda篇

Pytorch1.7适配cuda篇

由于3090、A10以后的显卡使用安培Ampere架构,不再支持cuda11以下版本,导致cuda、pytorch必须升级,进而导致过去开的的模型需要重新适配。根据适配过程中遇见的问题,做优化记录(持续更新)…

服务器环境

cuda: 11.2
cudnn: 8.0
pytorch: 1.7.1

适配记录

1、报错:error: identifier “AT_CHECK” is undefined

 error: identifier “AT_CHECK” is undefined

解决方法:找到报错的.cpp、.cu、.h文件,搜索并替换

“AT_CHECK”修改为“TORCH_CHECK”

2、报错:type().is_cuda()

 error: identifier “type().is_cuda()” is undefined

解决方法:找到报错的.cpp、.cu、.h文件,搜索并替换

“type().is_cuda()”修改为“is_cuda()”

3、报错: error: ‘THCState_getCurrentStream’ was not declared in this scope

  error: ‘THCState_getCurrentStream’ was not declared in this scope

解决方法:找到报错的.cpp、.cu、.h文件,搜索并替换

 cudaStream_t stream = THCState_getCurrentStream(state);修改为“cudaStream_t stream = c10::cuda::getCurrentCUDAStream();”
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/822763.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号