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

“nll

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

“nll

Traceback (most recent call last):
  File "D:nlpzhinengyunweiwh_lstm_pytorch.py", line 213, in 
    loss = loss_func(torch.squeeze(output), target)
  File "D:ProgramDataAnaconda3libsite-packagestorchnnmodulesmodule.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "D:ProgramDataAnaconda3libsite-packagestorchnnmodulesloss.py", line 1150, in forward
    return F.cross_entropy(input, target, weight=self.weight,
  File "D:ProgramDataAnaconda3libsite-packagestorchnnfunctional.py", line 2846, in cross_entropy
    return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing)
RuntimeError: "nll_loss_forward_reduce_cuda_kernel_2d_index" not implemented for 'Float'

发生在loss计算的时候,

loss_func(torch.squeeze(output), target)

改为:

loss_func(torch.squeeze(output), target.long())
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/768088.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

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

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