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
pytorch-grad-camGuides PyTorch grad-cam workflows for class activation maps, model/task adaptation, CAM metrics, method selection, and troubleshooting.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this repo skill for the grad-cam Python distribution, imported as
pytorch_grad_cam, when a task involves class activation maps, pixel
attribution, PyTorch vision explainability, CAM method selection, custom model
targets, reshape transforms, ROAD/ARCC metrics, Deep Feature Factorization, or
troubleshooting CAM outputs.
pip install grad-camimport pytorch_grad_camtimm for Swin examples,
transformers for CLIP/HuggingFace examples, vendor packages for HPU.Minimal public import check:
python - <<'PY'
from importlib.metadata import version
from pytorch_grad_cam import GradCAM, ScoreCAM, AblationCAM, FinerCAM
print("grad-cam", version("grad-cam"))
print(GradCAM, ScoreCAM, AblationCAM, FinerCAM)
PY
For a safe diagnostic that does not download models, run
scripts/check_grad_cam_environment.py.
For method names and installed signatures, run
scripts/inspect_cam_methods.py.
Read references/package-overview.md for the
verified package surface, dependencies, and workflow map. Read
references/troubleshooting.md when install,
import, optional dependency, device, or source-independence issues appear. Read
references/repo-provenance.md before deciding
whether this skill is stale for another checkout.
Read sub-skills/cam-generation/SKILL.md
when the task asks to produce Grad-CAM/CAM heatmaps for a PyTorch classifier,
choose target layers, target classes, smoothing options, guided backpropagation,
batch behavior, or a safe single-image smoke test.
Common triggers: "run GradCAM on my model", "overlay a heatmap", "why is my CAM blank", "use aug_smooth/eigen_smooth", "combine CAM with guided backprop", or "test GradCAM without downloading ImageNet weights".
Read
sub-skills/model-task-adaptation/SKILL.md
when activations or outputs are not ordinary CNN classification logits: ViT,
Swin, CLIP, HuggingFace vision models, object detection, semantic segmentation,
embeddings/similarity, custom target callables, reshape_transform, or
FasterRCNNBoxScoreTarget / SemanticSegmentationTarget.
Read
sub-skills/metrics-and-evaluation/SKILL.md
for ROAD metrics, confidence-change metrics, ARCC, RefineCAM,
Deep Feature Factorization, or tasks that compare/tune explanations rather than
only creating one heatmap.
Read sub-skills/methods-and-api/SKILL.md
for expert method tradeoffs, installed class signatures, lifecycle/context
manager behavior, method-specific gotchas, device/backends, FinerCAM,
SegEigenCAM, ShapleyCAM, KPCA-CAM, AblationCAM variants, or low-level API
questions.
ScoreCAM and AblationCAM as potentially expensive because they use
many forward passes; set cam.batch_size deliberately.with CAMClass(...) as cam: block when possible so hooks are released.