Skip to content

Some Stored Weights for Bundles Not Compatible With weights_only=True #9025

Description

@ericspod

Describe the bug
Some weights .pt files stored on the model zoo and Huggingface are not compatible with loading weights only. One example is the weights for pancreas_ct_dints_segmentation being stored as Numpy arrays, these should be stored as tensors and then the code for DINTS must be updated to not assume arrays (such as here).

To Reproduce
Steps to reproduce the behavior:

  1. Try loading the DINTS model with the given weights.
  2. Failure will occur with torch.load when loading the search_code_18590.pt file.

Expected behavior
Should load without complaint.

Environment

Ensuring you use the relevant python executable, please paste the output of:

================================
Printing MONAI config...
================================
MONAI version: 1.7.dev2630
Numpy version: 2.4.6
Pytorch version: 2.13.0+cu130
MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False
MONAI rev id: 82bbaeeb45e5490606c4ff4615dd85e0e83fce7c
MONAI __file__: /home/<username>/miniconda3/envs/rankseg_test/lib/python3.11/site-packages/monai/__init__.py

Optional dependencies:
Pytorch Ignite version: NOT INSTALLED or UNKNOWN VERSION.
ITK version: NOT INSTALLED or UNKNOWN VERSION.
Nibabel version: 5.4.2
scikit-image version: NOT INSTALLED or UNKNOWN VERSION.
scipy version: 1.17.1
Pillow version: 12.3.0
Tensorboard version: NOT INSTALLED or UNKNOWN VERSION.
gdown version: NOT INSTALLED or UNKNOWN VERSION.
TorchVision version: NOT INSTALLED or UNKNOWN VERSION.
tqdm version: 4.70.0
lmdb version: NOT INSTALLED or UNKNOWN VERSION.
psutil version: 7.2.2
pandas version: NOT INSTALLED or UNKNOWN VERSION.
einops version: NOT INSTALLED or UNKNOWN VERSION.
transformers version: NOT INSTALLED or UNKNOWN VERSION.
mlflow version: NOT INSTALLED or UNKNOWN VERSION.
pynrrd version: NOT INSTALLED or UNKNOWN VERSION.
clearml version: NOT INSTALLED or UNKNOWN VERSION.

For details about installing the optional dependencies, please visit:
    https://monai.readthedocs.io/en/latest/installation.html#installing-the-recommended-dependencies


================================
Printing system config...
================================
System: Linux
Linux version: Ubuntu 24.04.4 LTS
Platform: Linux-6.8.0-124-generic-x86_64-with-glibc2.39
Processor: x86_64
Machine: x86_64
Python version: 3.11.15
Process name: python
Command: []
Num physical CPUs: 64
Num logical CPUs: 128
Num usable CPUs: 128
CPU usage (%): [2.6, 0.8, 0.7, 0.5, 0.8, 0.4, 0.4, 0.5, 0.5, 0.8, 0.2, 0.3, 0.5, 0.2, 0.3, 0.9, 0.2, 0.2, 0.2, 1.2, 0.2, 0.3, 0.1, 0.6, 0.1, 0.4, 0.2, 0.1, 0.7, 0.1, 0.1, 0.1, 0.2, 0.5, 0.1, 0.1, 0.1, 0.1, 0.1, 0.0, 0.1, 0.1, 0.1, 0.0, 0.1, 0.0, 0.1, 0.1, 0.0, 0.0, 0.1, 0.0, 0.1, 0.1, 0.1, 0.0, 0.1, 0.0, 0.0, 0.1, 0.1, 0.0, 0.1, 0.0, 0.3, 0.1, 0.3, 0.0, 0.1, 0.2, 0.1, 0.2, 0.1, 0.1, 0.1, 0.4, 0.1, 0.5, 0.3, 0.0, 0.2, 0.1, 0.1, 0.7, 0.1, 0.1, 0.1, 1.5, 0.1, 0.0, 0.1, 0.1, 0.1, 0.1, 0.1, 0.2, 0.1, 0.2, 0.0, 0.1, 0.1, 0.0, 0.0, 0.0, 0.1, 0.0, 0.1, 0.0, 0.1, 0.0, 0.0, 0.1, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.1, 0.0, 0.3, 0.0, 0.1]
CPU freq. (MHz): 1904
Load avg. in last 1, 5, 15 mins (%): [0.1, 0.1, 0.2]
Disk usage (%): 93.1
Avg. sensor temp. (Celsius): UNKNOWN for given OS
Total physical memory (GB): 503.3
Available memory (GB): 463.9
Used memory (GB): 39.4

================================
Printing GPU config...
================================
Num GPUs: 4
Has CUDA: True
CUDA version: 13.0
cuDNN enabled: True
NVIDIA_TF32_OVERRIDE: None
TORCH_ALLOW_TF32_CUBLAS_OVERRIDE: None
cuDNN version: 92000
Current device: 0
Library compiled for CUDA architectures: ['sm_75', 'sm_80', 'sm_86', 'sm_90', 'sm_100', 'sm_120']
GPU 0 Name: NVIDIA A40
GPU 0 Is integrated: False
GPU 0 Is multi GPU board: False
GPU 0 Multi processor count: 84
GPU 0 Total memory (GB): 44.4
GPU 0 CUDA capability (maj.min): 8.6
GPU 1 Name: NVIDIA A40
GPU 1 Is integrated: False
GPU 1 Is multi GPU board: False
GPU 1 Multi processor count: 84
GPU 1 Total memory (GB): 44.4
GPU 1 CUDA capability (maj.min): 8.6
GPU 2 Name: NVIDIA A40
GPU 2 Is integrated: False
GPU 2 Is multi GPU board: False
GPU 2 Multi processor count: 84
GPU 2 Total memory (GB): 44.4
GPU 2 CUDA capability (maj.min): 8.6
GPU 3 Name: NVIDIA A40
GPU 3 Is integrated: False
GPU 3 Is multi GPU board: False
GPU 3 Multi processor count: 84
GPU 3 Total memory (GB): 44.4
GPU 3 CUDA capability (maj.min): 8.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status
    📋 Prioritised

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions