Project-MONAI / Project-MONAI/tutorials

nnunetv2 support for numpy >=2.0

Offen
#1,986 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug
Vorherrschende Sprache
Jupyter Notebook
Sterne
2.5k
Forks
803
Ø Merge
6 T. 22 Std.
Gemergte PRs (30 T.)
3

Beschreibung

[2025-05-01T13:49:17.542Z] + python -m tests.integration.test_integration_nnunetv2_runner

[2025-05-01T13:49:18.474Z] 

[2025-05-01T13:49:18.474Z] A module that was compiled using NumPy 1.x cannot be run in

[2025-05-01T13:49:18.474Z] NumPy 2.2.5 as it may crash. To support both 1.x and 2.x

[2025-05-01T13:49:18.474Z] versions of NumPy, modules must be compiled with NumPy 2.0.

[2025-05-01T13:49:18.474Z] Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

[2025-05-01T13:49:18.474Z] 

[2025-05-01T13:49:18.474Z] If you are a user of the module, the easiest solution will be to

[2025-05-01T13:49:18.474Z] downgrade to 'numpy<2' or try to upgrade the affected module.

[2025-05-01T13:49:18.474Z] We expect that some modules will need time to support NumPy 2.

[2025-05-01T13:49:18.474Z] 

[2025-05-01T13:49:18.474Z] Traceback (most recent call last):  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main

[2025-05-01T13:49:18.474Z]     return _run_code(code, main_globals, None,

[2025-05-01T13:49:18.474Z]   File "/usr/lib/python3.10/runpy.py", line 86, in _run_code

[2025-05-01T13:49:18.474Z]     exec(code, run_globals)

[2025-05-01T13:49:18.474Z]   File "/home/jenkins/agent/workspace/Monai-notebooks/MONAI/tests/integration/test_integration_nnunetv2_runner.py", line 21, in <module>

[2025-05-01T13:49:18.474Z]     from monai.apps.nnunet import nnUNetV2Runner

[2025-05-01T13:49:18.474Z]   File "/home/jenkins/agent/workspace/Monai-notebooks/MONAI/monai/__init__.py", line 83, in <module>

[2025-05-01T13:49:18.474Z]     from .utils.module import load_submodules  # noqa: E402

[2025-05-01T13:49:18.474Z]   File "/home/jenkins/agent/workspace/Monai-notebooks/MONAI/monai/utils/__init__.py", line 16, in <module>

[2025-05-01T13:49:18.474Z]     from .deprecate_utils import DeprecatedError, deprecated, deprecated_arg, deprecated_arg_default

[2025-05-01T13:49:18.474Z]   File "/home/jenkins/agent/workspace/Monai-notebooks/MONAI/monai/utils/deprecate_utils.py", line 22, in <module>

[2025-05-01T13:49:18.474Z]     from monai.utils.module import version_leq

[2025-05-01T13:49:18.474Z]   File "/home/jenkins/agent/workspace/Monai-notebooks/MONAI/monai/utils/module.py", line 30, in <module>

[2025-05-01T13:49:18.474Z]     import torch

[2025-05-01T13:49:18.474Z]   File "/usr/local/lib/python3.10/dist-packages/torch/__init__.py", line 2479, in <module>

[2025-05-01T13:49:18.474Z]     from torch import (

[2025-05-01T13:49:18.474Z]   File "/usr/local/lib/python3.10/dist-packages/torch/export/__init__.py", line 64, in <module>

[2025-05-01T13:49:18.474Z]     from .dynamic_shapes import Constraint, Dim, dims, ShapesCollection

[2025-05-01T13:49:18.474Z]   File "/usr/local/lib/python3.10/dist-packages/torch/export/dynamic_shapes.py", line 22, in <module>

[2025-05-01T13:49:18.474Z]     from .exported_program import ExportedProgram

[2025-05-01T13:49:18.474Z]   File "/usr/local/lib/python3.10/dist-packages/torch/export/exported_program.py", line 27, in <module>

[2025-05-01T13:49:18.474Z]     from torch._higher_order_ops.utils import autograd_not_implemented

[2025-05-01T13:49:18.474Z]   File "/usr/local/lib/python3.10/dist-packages/torch/_higher_order_ops/__init__.py", line 1, in <module>

[2025-05-01T13:49:18.474Z]     from torch._higher_order_ops.cond import cond

[2025-05-01T13:49:18.474Z]   File "/usr/local/lib/python3.10/dist-packages/torch/_higher_order_ops/cond.py", line 6, in <module>

[2025-05-01T13:49:18.474Z]     import torch._subclasses.functional_tensor

[2025-05-01T13:49:18.474Z]   File "/usr/local/lib/python3.10/dist-packages/torch/_subclasses/functional_tensor.py", line 44, in <module>

[2025-05-01T13:49:18.474Z]     class FunctionalTensor(torch.Tensor):

[2025-05-01T13:49:18.474Z]   File "/usr/local/lib/python3.10/dist-packages/torch/_subclasses/functional_tensor.py", line 271, in FunctionalTensor

[2025-05-01T13:49:18.474Z]     cpu = _conversion_method_template(device=torch.device("cpu"))

[2025-05-01T13:49:18.474Z] /usr/local/lib/python3.10/dist-packages/torch/_subclasses/functional_tensor.py:271: UserWarning: Failed to initialize NumPy: _ARRAY_API not found (Triggered internally at /opt/pytorch/pytorch/torch/csrc/utils/tensor_numpy.cpp:84.)

[2025-05-01T13:49:18.474Z]   cpu = _conversion_method_template(device=torch.device("cpu"))

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der Ausführung von tests/integration/test_integration_nnunetv2_runner.py und untersuche den im Traceback angezeigten Importpfad. Verfolge den NumPy-Kompatibilitätsfehler durch die Integrationskonfiguration von nnUNetV2; abgeschlossen ist die Aufgabe, wenn dieser Integrationstest mit NumPy 2.x ohne die gemeldete Initialisierungswarnung erfolgreich ausgeführt wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
numpy, python, pytorch
Bereich
machine-learning, testing-qa
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.