Registry / ai-ml / nnunetv2

nnunetv2

JSON →
library2.8.0pypypiunverified

nnU-Net is a self-adapting framework for biomedical image segmentation that automatically configures itself for new datasets. Version 2.7.0 reworks the dataset conversion and introduces new training modes. Active development, monthly releases.

pip install nnunetv2
INSTALL
IMPORT
SIG · NNUNETV2
N
nnunetv2
ai-mlpythonv2.8.0
Install
97.4s avg
Import
Disk
5769MB
Pass rate
3/ 10
Env Coverage3 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.8.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
1/2 runs
py 3.11
✕ build_error
✓ 104.2s
py 3.12
✕ build_error
✓ 96.3s
py 3.13
✕ build_error
✓ 91.6s
py 3.9
✕ build_error
✕ build_error
5769MB installed
● package 5769MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

nnUNetPlanner
from nnunetv2.experiment_planning.plan_and_configurator import nnUNetPlanner
from nnunetv2.experiment_planning.plan_and_configurator import nnUNetPlanner

Prepares environment variables, converts a Medical Segmentation Decathlon dataset, plans preprocessing, and runs a 2D training fold.

import os os.environ['nnUNet_raw'] = '/path/to/nnUNet_raw' os.environ['nnUNet_preprocessed'] = '/path/to/nnUNet_preprocessed' os.environ['nnUNet_results'] = '/path/to/nnUNet_results' # Convert dataset (Task002_Heart example) from nnunetv2.dataset_conversion import convert_MSD_dataset convert_MSD_dataset.convert_msd_dataset('/path/to/Task02_Heart') # Plan & preprocess from nnunetv2.experiment_planning.plan_and_configurator import nnUNetPlanner planner = nnUNetPlanner(dataset_name_or_id='002', plans_identifier='nnUNetPlans') planner.plan_and_preprocess() # Train 2D U-Net from nnunetv2.run.run_training import run_training run_training('002', '2d', 0, plans_identifier='nnUNetPlans')
nnUNet --version
Debug
Known issues
breakingFrom v2.0, the environment variables nnUNet_raw_data_base and nnUNet_preprocessed are replaced by nnUNet_raw, nnUNet_preprocessed, and nnUNet_results. Old scripts will break.
fix
Set new env vars: nnUNet_raw, nnUNet_preprocessed, nnUNet_results. Update scripts that used the old names.
affects: >=2.0
breakingThe dataset JSON format changed. The 'labels' field now uses a dictionary for old label names to new ones, and the 'modality' field must be a dict.
fix
Update dataset.json to follow the new schema. See https://github.com/MIC-DKFZ/nnUNet/blob/master/documentation/dataset_format.md
affects: >=2.2
deprecatedThe use of 'nnUNet_compile' flag is deprecated. Use PyTorch's torch.compile directly.
fix
Replace nnUNet_compile=True with torch.compile(model) in your training script.
affects: >=2.7
gotchaTraining on Windows may fail due to the default CUDA memory allocation policy or path length limits. Linux is the only officially supported OS.
fix
Use Linux (Ubuntu) or WSL2. Ensure short paths (e.g., C:\nnunet).
affects: all
gotchannU-Net v2 no longer supports multi-GPU training via nnUNet_train. Use PyTorch DDP manually.
fix
Run training with torchrun: torchrun --nnodes=1 --nproc_per_node=4 --master_port=xxxx nnunetv2/run/run_training.py ...
affects: >=2.0
Upgrade
Version history
2.8.0latest on PyPI · released Jun 7, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources