稻壳er 2023-03-15 16:54 采纳率: 0%
浏览 182

torch.gather()结果无法复现

深度学习模型中已经固定了随机数种子,使用torch.gather()函数仍然会导致结果不可复现。(使用 torch.use_deterministic_algorithms(True)会抛出异常)。网上关于torch.gather() 确定性的内容较少,请问这是否是一个通用的问题,以及如何解决?

异常信息:RuntimeError: scatter_add_cuda_kernel does not have a deterministic implementation, but you set 'torch.use_deterministic_algorithms(True)'. You can turn off determinism just for this operation, or you can use the 'warn_only=True' option, if that's acceptable for your application. You can also file an issue at https://github.com/pytorch/pytorch/issues to help us prioritize adding deterministic support for this operation.

  • 写回答

3条回答 默认 最新

  • CSDN-Ada助手 CSDN-AI 官方账号 2023-03-15 18:32
    关注
    评论

报告相同问题?

问题事件

  • 修改了问题 3月15日
  • 创建了问题 3月15日