对于Pytorch的结果复现,在不同版本的pytorch或者不同的硬件平台之间,不能够保证结果是完全一致的,即使在CPU和GPU上采用相同的随机数种子。

关于torch.backend.cudnn.benchmark, (CuDNN backend是什么

torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False

是相对来说确定性的模式。

包括Conv2d这样的函数,In some circumstances when using the CUDA backend with CuDNN, this operator may select a nondeterministic algorithm to increase performance. If this is undesirable, you can try to make the operation deterministic (potentially at a performance cost) by setting torch.backends.cudnn.deterministic = True.

相关文章:

  • 2021-10-22
  • 2022-12-23
  • 2021-10-22
  • 2021-11-19
  • 2021-12-14
  • 2021-06-04
  • 2021-12-18
  • 2021-07-17
猜你喜欢
  • 2021-11-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
  • 2021-10-12
相关资源
相似解决方案