会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
qwangg
博客园
首页
新随笔
联系
订阅
管理
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!
错误原因:数据有的在cpu上有的在gpu上
debug:断点到出错位置查看类型,或者打印`x.is_cuda`查看
修改:将cpu上的数据通过`.to(device)`加载到gpu上
posted @
2023-02-09 16:18
不要肥宅
阅读(
1967
) 评论(
0
)
编辑
收藏
举报
刷新页面
返回顶部
公告