You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A postprocessing.pkl was not generated in ./nnUNet_results/Dataset004_Hippocampus/ensembles/ensemble___nnUNetTrainer__nnUNetPlans__2d___nnUNetTrainer__nnUNetPlans__3d_fullres___0_1_2/
so I can't execute nnUNetv2_apply_postprocessing , what should I do?
THANKS
This is a workflow issue — nnUNetv2_ensemble on test-set predictions intentionally does not generate postprocessing.pkl. That file can only be created by nnUNetv2_determine_postprocessing, which requires ground-truth labels to evaluate whether removing all-but-largest components improves Dice scores.
Root cause
postprocessing.pkl is generated by determine_postprocessing(), which compares model output against reference segmentations. Your test set (imagesTs) has no labels, so this step cannot be run on test-set predictions directly.
The intended workflow is:
Determine postprocessing on cross-validation predictions (where GT labels exist)
Apply the resulting postprocessing.pkl to test-set ensemble predictions
Solution
Step 1 — Re-run validation with .npz output (if not already done)
If you trained without --npz, re-run validation for each fold:
Note: -plans_json and -dataset_json are required for ensemble output folders because nnUNetv2_ensemble does not copy a plans.json into the output folder (only dataset.json is copied — see ensemble.py#L96).
References
documentation/how_to_use_nnunet.md — the "Ensembling multiple configurations" and "Apply postprocessing" sections describe this workflow
Activity
yulinnauu commentedon Jun 12, 2025
Have you figured it out? meet with the same problem
mrokuss commentedon Apr 13, 2026
Let's ask @claude if he can help!
github-actions commentedon Apr 13, 2026
🤖 nnU-Net Assistant
This is a workflow issue —
nnUNetv2_ensembleon test-set predictions intentionally does not generatepostprocessing.pkl. That file can only be created bynnUNetv2_determine_postprocessing, which requires ground-truth labels to evaluate whether removing all-but-largest components improves Dice scores.Root cause
postprocessing.pklis generated bydetermine_postprocessing(), which compares model output against reference segmentations. Your test set (imagesTs) has no labels, so this step cannot be run on test-set predictions directly.The intended workflow is:
postprocessing.pklto test-set ensemble predictionsSolution
Step 1 — Re-run validation with
.npzoutput (if not already done)If you trained without
--npz, re-run validation for each fold:Step 2 — Run
nnUNetv2_find_best_configurationThis command will:
postprocessing.pklat:$nnUNet_results/Dataset004_Hippocampus/ensembles/ensemble___nnUNetTrainer__nnUNetPlans__2d___nnUNetTrainer__nnUNetPlans__3d_fullres___0_1_2/postprocessing.pklinference_instructions.txt)Step 3 — Apply postprocessing to your test ensemble
Note:
-plans_jsonand-dataset_jsonare required for ensemble output folders becausennUNetv2_ensembledoes not copy aplans.jsoninto the output folder (onlydataset.jsonis copied — seeensemble.py#L96).References
documentation/how_to_use_nnunet.md— the "Ensembling multiple configurations" and "Apply postprocessing" sections describe this workflowpostprocessing/remove_connected_components.py:297—nnUNetv2_determine_postprocessingCLI entry pointmrokuss commentedon Nov 20, 2026
Closing due to inactivity, feel free to reopen :)