会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
mactor
博客园
首页
新随笔
联系
订阅
管理
05 2024 档案
PyTorch loss写法的版本变更 | IndexError: invalid index of a 0-dim tensor. Use `tensor.item()` in Python or `tensor.item<T>()` in C++ to convert a 0-dim tensor to a number
摘要:自己遇到了这个问题,记录一下 以下写法 print_loss = loss.data[0] 在PyTorch>=0.5时,报错 IndexError: invalid index of a 0-dim tensor. Use tensor.item() in Python or tensor.ite
阅读全文
posted @
2024-05-11 19:06
Mactor
阅读(58)
评论(0)
推荐(0)
公告