mmengine icon indicating copy to clipboard operation
mmengine copied to clipboard

add weights_only argument for torch load to support new version of torch

Open dianyo opened this issue 9 months ago • 2 comments

Motivation

torch.load start raise error in newer version if not specify weights_only=False, where the default behavior is True.

Modification

  • Update yapf using newer version to avoid lib2to3 not support issue after python3.10 ref: https://github.com/google/yapf/issues/993
  • Add weights_only=False to all torch.load calling in the codebase

Checklist

  • [X] Pre-commit or other linting tools are used to fix the potential lint issues.
  • [X] The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  • [ ] If the modification has potential influence on downstream projects, this PR should be tested with downstream projects, like MMDetection or MMPretrain.
  • [ ] The documentation has been modified accordingly, like docstring or example tutorials.

dianyo avatar Feb 21 '25 08:02 dianyo

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Feb 21 '25 08:02 CLAassistant

looks the circle ci is broken, i can do pre-commit and make sure that lint all looks good. It might comes from manifest files issue. Screenshot 2025-02-21 at 4 36 45 PM

dianyo avatar Feb 21 '25 08:02 dianyo