会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
博客园
首页
新随笔
联系
订阅
管理
随笔分类 -
深度学习error
RuntimeError: Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead.
摘要:出错代码: 点击查看代码 dataset_numpy = x[0].cpu().numpy() centers = centers.cpu().numpy() codes = codes.cpu().numpy() 修改后代码: 点击查看代码 dataset_numpy = x[0].cpu().d
阅读全文
posted @
2022-11-23 13:28
荒北
阅读(1447)
评论(0)
推荐(0)
Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument index in method wrapper__index_select)
摘要:数据不在同一设备 将device = d2l.try_gpu() 改为device = torch.device('cpu') 62seq2seq
阅读全文
posted @
2022-07-06 20:31
荒北
阅读(1356)
评论(0)
推荐(0)
公告