inference-evaluation
Run nnU-Net v2 prediction from dataset/results or explicit model folders, cascades, TTA/tiling/device/process controls, ensembling, postprocessing, evaluation, best-configuration selection, model sharing, and inference troubleshooting.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- inference-evaluation
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Run nnU-Net v2 prediction from dataset/results or explicit model folders, cascades, TTA/tiling/device/process controls, ensembling, postprocessing, evaluation, best-configuration selection, model sharing, and inference troubleshooting.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/cli-reference.md6.9 KB
- 参考文档references/inference-and-evaluation.md8.0 KB
- 参考文档references/model-sharing.md4.3 KB
- 参考文档references/troubleshooting.md6.1 KB
- 脚本scripts/check_inference_inputs.py5.6 KB
03 SKILL.md 正文
nnU-Net v2 Inference and Evaluation
Use this sub-skill after a trained, installed, exported, downloaded, or otherwise available nnU-Net v2 model exists and the task is to generate predictions, compare configurations, ensemble outputs, evaluate segmentations, apply postprocessing, or move models between environments.
Route here for
- Running
nnUNetv2_predictfromnnUNet_resultswith dataset id/name, trainer, plans, configuration, folds, checkpoint, device, TTA, tiling, process, and split-batch flags. - Running
nnUNetv2_predict_from_modelfolderwhen the model folder is explicit ornnUNet_resultsis unavailable. - Providing previous-stage predictions for cascaded models with
-prev_stage_predictions. - Saving probability maps for downstream
nnUNetv2_ensembleand applyingpostprocessing.pkl. - Evaluating predictions with
nnUNetv2_evaluate_folderornnUNetv2_evaluate_simple, including ignore labels and partial-prediction--chillbehavior. - Selecting the best trained configuration with
nnUNetv2_find_best_configurationafter validation probabilities exist. - Exporting, installing, downloading, or sharing trained/pretrained models, including custom-trainer availability requirements.
Do not handle here
- Creating dataset folders, channel names, labels, or inference input naming from scratch: use
data-preparation. - Planning, preprocessing, experiment planners, or fingerprints: use
planning-preprocessing. - Training folds, validation reruns,
--npzrecovery, checkpoint creation, or trainer selection for training: usetraining-configuration. - Implementing custom trainer subclasses or extension code: use
customization-extension; this sub-skill only explains how inference locates custom trainer classes.
Fast Path
- Confirm the model exists and matches the input dataset: trained result folder with
dataset.json,plans.json, and requestedfold_*checkpoints, or an explicit model folder with the same files. - Check inference image filenames before running expensive prediction:
python sub-skills/inference-evaluation/scripts/check_inference_inputs.py INPUT_FOLDER MODEL_OR_DATASET_JSON - Use
nnUNetv2_predictwhen the model is innnUNet_results:nnUNetv2_predict -i INPUT_FOLDER -o OUTPUT_FOLDER -d DATASET001_Example -c 3d_fullres -f 0 1 2 3 4 - Use
nnUNetv2_predict_from_modelfolderwhen the model folder is explicit:nnUNetv2_predict_from_modelfolder -i INPUT_FOLDER -o OUTPUT_FOLDER -m MODEL_FOLDER -f 0 1 2 3 4 - Add
--save_probabilitieswhen predictions will be ensembled; runnnUNetv2_ensemble, then apply postprocessing if apostprocessing.pklwas selected. - Evaluate predictions with
nnUNetv2_evaluate_folderwhendataset.jsonandplans.jsonare available, ornnUNetv2_evaluate_simplefor label-list evaluation.
Bundled References
references/cli-reference.md: exact command routes, flags, defaults, and entry-point distinctions.references/inference-and-evaluation.md: workflows for prediction, cascades, ensembling, postprocessing, evaluation, best-configuration selection, and Python API use.references/model-sharing.md: export/import/download commands and custom-trainer portability rules.references/troubleshooting.md: failure-mode triage for input names, checkpoints, model folders, probabilities, postprocessing metadata, split jobs, devices, and custom trainers.
Bundled Helper
check_inference_inputs.py validates input-folder case/channel naming against dataset.json without loading images or importing nnU-Net. It accepts either a dataset.json path or a model/results folder containing dataset.json.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).