将loss.py中gain = torch.ones(7, device=targets.device)改为gain = torch.ones(7, device=targets.device).long()即可。
原因是新版本的torch无法自动执行此转换,旧版本torch可以。
将loss.py中gain = torch.ones(7, device=targets.device)改为gain = torch.ones(7, device=targets.device).long()即可。
原因是新版本的torch无法自动执行此转换,旧版本torch可以。