Use this reference when you need to verify official nnUNet v2 conventions.
nnUNet_raw, nnUNet_preprocessed, and nnUNet_results.nnUNet_results is the primary source for trained or downloaded model availability.RESULTS_FOLDER is not the primary nnUNet v2 convention; use it only as a legacy fallback.The official training output layout is:
nnUNet_results/DatasetXXX_NAME/TRAINER__PLANS__CONFIGURATION/fold_x
Typical trainer-level files:
dataset.jsondataset_fingerprint.jsonplans.jsonTypical fold-level files:
checkpoint_final.pthcheckpoint_best.pthdebug.jsoncheckpoint_final.pth is the standard inference checkpoint.
If nnUNetv2_find_best_configuration was run, nnUNet may also create:
inference_instructions.txtinference_information.jsonPrefer inference_instructions.txt when it exists.
When reading nnUNet v2 metadata:
channel_nameslabelsbackground should be 0Label values may appear as integers, strings, or region definitions depending on dataset style. Normalize simple numeric strings when summarizing, but do not change semantic meaning.
dataset.json as the source of truth for deployed labels and modalities.dataset/*.json as a supplemental routing library.Core prediction pattern:
nnUNetv2_predict -i INPUT_FOLDER -o OUTPUT_FOLDER -d DATASET_NAME_OR_ID -c CONFIGURATION
Notes:
--save_probabilities only if you intend to ensemble predictions later-f allEnsembling:
nnUNetv2_ensemble -i FOLDER1 FOLDER2 -o OUTPUT_FOLDER -np NUM_PROCESSES
Postprocessing:
nnUNetv2_apply_postprocessing -i FOLDER_WITH_PREDICTIONS -o OUTPUT_FOLDER --pp_pkl_file POSTPROCESSING_FILE -plans_json PLANS_FILE -dataset_json DATASET_JSON_FILE
For custom trainer folders, the safer path is to initialize from the trained model folder directly.
from nnunetv2.inference.predict_from_raw_data import nnUNetPredictor
Useful methods:
initialize_from_trained_model_folder(...)predict_from_files(...)This avoids reconstructing trainer or plans choices from memory when the deployed model folder is non-default.
documentation/setting_up_paths.mddocumentation/dataset_format.mddocumentation/how_to_use_nnunet.md