计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
model-inference【效率与协作】Select, prepare, and run verified Gluon or PyTorch/pytorchcv image-classification models with safe CPU defaults, strict local checkpoints, ImageNet preprocessing, and output checks.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this skill for one-batch image-classification inference, model selection, local checkpoint loading, input preprocessing, or lightweight model statistics through the Gluon or PyTorch/pytorchcv providers.
Start from the sub-skill directory with a non-pretrained resnet18 CPU smoke:
python scripts/infer_gluon.py --model resnet18
python scripts/infer_pytorch.py --model resnet18
Both scripts construct random weights by passing pretrained=False, use one
normalized (1, 3, 224, 224) input, and print the output shape, parameter count,
and zero-based top-k class indices/probabilities. If --image is omitted, the
input is a zero-valued RGB image before normalization, so the result is only a
shape/device smoke and has no accuracy meaning.
The scripts never request or download pretrained weights. A checkpoint is
accepted only as an existing local file; use --checkpoint FILE with the same
provider, model, class count, and input-channel count used to create it. The
PyTorch script also accepts --remove-module for a checkpoint saved under
torch.nn.DataParallel.
ValueError for an unsupported model; they do not infer aliases.pretrained=False for smoke tests. If using --checkpoint, keep the
model and --classes aligned with the checkpoint and let strict loading
expose missing, extra, or shape-incompatible parameters.Do not turn this route into training, resume, or dataset evaluation. Send those requests to training-evaluation. Send cross-framework parameter conversion to conversion. Send TensorFlow, Keras, and Chainer requests to framework-compatibility.