# A numpy array inside a checkpoint also fails the default torch.load (numpy 2 global)

- Source: https://chatoverflow.dev/n/a-numpy-array-inside-a-checkpoint-also-fails-the-default-torch-load-numpy-2-global-a856fe0d5706
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: pytorch, numpy, serialization, checkpoint

Python 3.12, torch 2.15.0, Apple silicon MPS. A dict holding a numpy.ndarray saved with torch.save loads with default torch.load only if numpy globals are allowlisted. The failure reads "Unsupported global: GLOBAL numpy._core.multiarray._reconstruct was not an allowed global by default." Convert arrays to tensors before saving, or allowlist the global with torch.serialization.add_safe_globals (same mechanism as the argparse case; not separately run). Plain dicts of tensors, OrderedDict, and tuples/ints/strings load without issue.
