executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
trainingOperate CUDA-based train.py adaptation runs for Medical SAM Adapter across SAM, EfficientSAM, MobileSAM, Adapter, LoRA, AdaLoRA, 2D, 3D, and multi-class configurations.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this route to construct and diagnose the repository's train.py
adaptation workflow. It is a self-contained operating guide, not a copied
launcher: it never downloads weights or data and never requires the source
checkout at runtime.
If the question is about dataset names, file layouts, sample dictionaries, prompts, tensor shapes, or whether a checkpoint is a base model, start with data preparation.
Read the exact parser reference. In
particular, inspect the effective values of the type=bool options instead
of trusting their spelling.
Select a network/encoder pair from
model variants, then run the static helper
before importing model code. It supports --help, --list, and an object
or file supplied through --json:
python scripts/inspect_model_registry.py --net sam --encoder vit_b --mod sam_adpt
python scripts/inspect_model_registry.py --json '{"net":"mobile_sam","encoder":"tiny_vit","mod":"sam_lora"}' --output json
Check that -sam_ckpt is an existing local base-model checkpoint for the
selected builder. A -weights file is a different training-wrapper
checkpoint; do not substitute one for the other.
Confirm a CUDA-capable PyTorch environment, the visible device, data
contract, output destination, positive -vis, and a unique -exp_name.
Use the workflow patterns without adding any
download step.
default, vit_b, vit_h, and vit_l.default, vit_s, and vit_t.train.py calls. The compatibility warnings are in
model variants.sam_adpt, sam_lora, and sam_adalora change image-encoder construction
and/or trainable parameters. Their behavior is network-specific; do not
assume that an AdaLoRA or LoRA mode creates LoRA layers for every MobileSAM
entry. See adapter mechanics.-thd True is the source's 3D slice/chunk path. -chunk controls the
training crop/depth path, -evl_chunk controls validation windows, and
-num_sample/-roi_size affect MONAI sampling. Dataset ownership remains
with data preparation.-multimask_output > 1; EfficientSAM and MobileSAM pass
multimask_output=False in the training loop. Independent scores belong to
evaluation, while detector/box inference belongs
to mobile inference.The actual training path creates cuda:<gpu_device> tensors, initializes CUDA
AMP, and moves the network and data to CUDA. -gpu False does not make it CPU
safe. CPU parser/help checks are diagnostics only, not successful training.
-distributed is an opt-in DataParallel path and still needs all listed
CUDA devices. Do not claim a run succeeded without a real CUDA execution.
Preserve the exact command, effective parser values, network/encoder, mode, checkpoint provenance, data root, device, and output paths in any handoff. For root-level routing and shared failures, use the Medical SAM Adapter root skill and its shared troubleshooting when present. For input preparation use data preparation; for checkpoint scoring use evaluation; for the separate object-aware route use mobile inference.
Read the detailed CLI reference, model variants, adapter mechanics, workflow patterns, and troubleshooting before a long run.