Skip to content
Back to skills

Cnn Model Building

ASecurity

"Build CPU-safe PyTorch CNN layers and model helpers with MMCV

  • 247 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 8, 2026
toolspythonc++bashapi

Works with

  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill cnn-model-building --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cnn Model Building?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cnn Model Building
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-cnn-model-building/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-cnn-model-building)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: cnn-model-building
description: "Build CPU-safe PyTorch CNN layers and model helpers with MMCV
  builders, module bundles, wrappers, plugins, transformers, and complexity
  utilities."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# MMCV CNN Model Building

Use this sub-skill when a task needs MMCV's PyTorch-dependent CNN construction helpers: config-style layer builders, `ConvModule`, depthwise separable blocks, wrapper layers, plugin blocks, transformer bricks, model complexity checks, or small ResNet/VGG helper layers.

Do not use this sub-skill for compiled CUDA/C++ ops installation or `mmcv.ops` runtime failures; route those to `ops-and-builds`. Do not use it for image preprocessing or data transforms; route those to `media-processing` or `data-transforms`.

## Quick Workflow

1. Confirm `torch` and `mmcv` import before using `mmcv.cnn`; MMCV Lite can build pure PyTorch CNN layers but does not provide compiled `mmcv._ext` ops.
2. Choose the smallest builder: `build_conv_layer`, `build_norm_layer`, `build_activation_layer`, `build_padding_layer`, `build_upsample_layer`, or `build_plugin_layer`.
3. Prefer `ConvModule` for conv/norm/activation bundles and explicitly set `norm_cfg`, `act_cfg`, `bias`, and `order` when matching existing PyTorch behavior.
4. Use `DepthwiseSeparableConvModule`, `ContextBlock`, `NonLocal*`, `Scale`, wrappers, `fuse_conv_bn`, and `get_model_complexity_info` only where their assumptions match the model.
5. For custom layers, register with `mmengine.registry.MODELS` before building from config.
6. Run the bundled smoke helper after edits or environment changes:

```bash
python scripts/cnn_builder_smoke.py
```

## References

- [API Reference](references/api-reference.md): builder signatures, supported config `type` values, return conventions, and module parameters.
- [Workflows](references/workflows.md): recipes for layer configs, `ConvModule` migration, registry extension, fusion, complexity, and CPU-safe transformer bricks.
- [Troubleshooting](references/troubleshooting.md): common config, torch, registry, shape, bias, order, plugin, and optional-ops failures.

Files in this skill

  • SKILL.md2.1 KB
  • references/api-reference.md7.4 KB
  • references/troubleshooting.md7 KB
  • references/workflows.md6.8 KB
  • scripts/cnn_builder_smoke.py8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.