Skip to content

Conversation

@GaetanLepage
Copy link
Contributor

@GaetanLepage GaetanLepage commented May 5, 2025

Things done

Backport of open-mmlab/mmengine#1650.

Fixes:

_pickle.UnpicklingError: Weights only load failed. This file can still be loaded, to do so you have two options, do those steps only if you trust the source of the checkpoint.
    (1) In PyTorch 2.6, we changed the default value of the `weights_only` argument in `torch.load` from `False` to `True`. Re-running `torch.load` with `weights_only` set to `False` will likely succeed, but it can result in arbitrary code execution. Do it only if you got the file from a trusted source.
    (2) Alternatively, to load with `weights_only=True` please check the recommended steps in the following error message.
    WeightsUnpickler error: Unsupported global: GLOBAL mmengine.logging.history_buffer.HistoryBuffer was not an allowed global by default. Please use `torch.serialization.add_safe_globals([HistoryBuffer])` or the `torch.serialization.safe_globals([HistoryBuffer])` context manager to allowlist this global if you trust this class/function.

Check the documentation of torch.load to learn more about types accepted by default with weights_only https://pytorch.org/docs/stable/generated/torch.load.html.

cc @benxiao

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels May 5, 2025
@nix-owners nix-owners bot requested a review from benxiao May 5, 2025 11:39
@GaetanLepage
Copy link
Contributor Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 404344


x86_64-linux

✅ 4 packages built:
  • python312Packages.mmcv
  • python312Packages.mmcv.dist
  • python312Packages.mmengine
  • python312Packages.mmengine.dist

aarch64-linux

✅ 4 packages built:
  • python312Packages.mmcv
  • python312Packages.mmcv.dist
  • python312Packages.mmengine
  • python312Packages.mmengine.dist

x86_64-darwin

⏩ 4 packages marked as broken and skipped:
  • python312Packages.mmcv
  • python312Packages.mmcv.dist
  • python312Packages.mmengine
  • python312Packages.mmengine.dist

aarch64-darwin

⏩ 4 packages marked as broken and skipped:
  • python312Packages.mmcv
  • python312Packages.mmcv.dist
  • python312Packages.mmengine
  • python312Packages.mmengine.dist

@GaetanLepage GaetanLepage merged commit e1e8a6b into NixOS:master May 5, 2025
59 checks passed
@GaetanLepage GaetanLepage deleted the mmengine branch May 5, 2025 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants