setup-build
Use this sub-skill when a task involves installing AdelaiDet, selecting PyTorch/Detectron2/CUDA versions, building adet._C, checking custom operators, or diagnosing import/build failures.
Use this route for
- Creating a fresh environment for AdelaiDet.
- Choosing a Detectron2 wheel that matches PyTorch and CUDA.
- Building
AdelaiDet editable from source.
- Verifying
adet.config.get_cfg, Detectron2 registries, adet._C, BezierAlign, DefROIAlign, and multi-label NMS.
- Fixing build failures such as missing torch in build isolation, missing CUDA headers, missing THC headers, Pillow/rapidfuzz/OpenCV incompatibilities, or CUDA architecture problems.
Do not use this route for
- Choosing a model config after installation succeeds. Use
../train-eval/SKILL.md.
- Demo commands with an already working install. Use
../demo-visualize/SKILL.md.
- Dataset annotation conversion. Use
../data-prep/SKILL.md.
- ONNX and checkpoint conversion. Use
../export-convert/SKILL.md.
Read first
references/setup-build.md for the known-good install recipe and version pins.
references/runtime-checks.md for what each smoke check proves.
../../references/compatibility.md for package-version rationale.
../../references/troubleshooting.md for cross-cutting error fixes.
Skill-owned scripts
../../scripts/check_install.py — package/config/registry/extension smoke check, with optional --cuda-ops.
Standard workflow
Create the compatible Python/PyTorch/CUDA/Detectron2 environment described in references/setup-build.md.
Install AdelaiDet with python -m pip install --no-build-isolation -e <checkout>.
Pin compatibility fixes: Pillow<10, rapidfuzz<3, NumPy 1.23.x, and OpenCV headless 4.8.x.
Run:
python ../../scripts/check_install.py --cuda-ops
If --cuda-ops fails, do not start training or inference; fix setup first or explicitly narrow the task to import/config-only analysis.
Decision points
- Need unmodified CUDA extension? Use PyTorch 1.10.x + CUDA 11.3. PyTorch 2.x is not the default.
- No GPU available? You may perform import/config-only checks without
--cuda-ops, but record that DefROIAlign and native _C.ml_nms are not validated.
- Need ONNX/TensorRT/NCNN? First prove the base AdelaiDet install, then switch to
export-convert for optional deployment runtimes.
Success signal
A healthy CUDA-capable environment reports:
import adet succeeds.
adet._C exposes BezierAlign, DefROIAlign, and ml_nms symbols.
scripts/check_install.py --cuda-ops exits 0.
- CLI help for training/demo/visualization/export can import all required modules.
1---2name: "setup-build"3description: "Guides legacy-compatible AdelaiDet installation,4 Detectron2/PyTorch/CUDA version selection, editable extension builds, and5 runtime smoke checks."6disable-model-invocation: true7metadata:8 source: https://skillmd.com/skills/vectorspacelab/setup-build9 disco-role: operating10license: NOASSERTION11---1213# setup-build1415Use this sub-skill when a task involves installing AdelaiDet, selecting PyTorch/Detectron2/CUDA versions, building `adet._C`, checking custom operators, or diagnosing import/build failures.1617## Use this route for1819- Creating a fresh environment for AdelaiDet.20- Choosing a Detectron2 wheel that matches PyTorch and CUDA.21- Building `AdelaiDet` editable from source.22- Verifying `adet.config.get_cfg`, Detectron2 registries, `adet._C`, BezierAlign, DefROIAlign, and multi-label NMS.23- Fixing build failures such as missing torch in build isolation, missing CUDA headers, missing THC headers, Pillow/rapidfuzz/OpenCV incompatibilities, or CUDA architecture problems.2425## Do not use this route for2627- Choosing a model config after installation succeeds. Use `../train-eval/SKILL.md`.28- Demo commands with an already working install. Use `../demo-visualize/SKILL.md`.29- Dataset annotation conversion. Use `../data-prep/SKILL.md`.30- ONNX and checkpoint conversion. Use `../export-convert/SKILL.md`.3132## Read first3334- `references/setup-build.md` for the known-good install recipe and version pins.35- `references/runtime-checks.md` for what each smoke check proves.36- `../../references/compatibility.md` for package-version rationale.37- `../../references/troubleshooting.md` for cross-cutting error fixes.3839## Skill-owned scripts4041- `../../scripts/check_install.py` — package/config/registry/extension smoke check, with optional `--cuda-ops`.4243## Standard workflow44451. Create the compatible Python/PyTorch/CUDA/Detectron2 environment described in `references/setup-build.md`.462. Install AdelaiDet with `python -m pip install --no-build-isolation -e <checkout>`.473. Pin compatibility fixes: `Pillow<10`, `rapidfuzz<3`, NumPy `1.23.x`, and OpenCV headless `4.8.x`.484. Run:4950 ```bash51 python ../../scripts/check_install.py --cuda-ops52 ```53545. If `--cuda-ops` fails, do not start training or inference; fix setup first or explicitly narrow the task to import/config-only analysis.5556## Decision points5758- **Need unmodified CUDA extension?** Use PyTorch 1.10.x + CUDA 11.3. PyTorch 2.x is not the default.59- **No GPU available?** You may perform import/config-only checks without `--cuda-ops`, but record that DefROIAlign and native `_C.ml_nms` are not validated.60- **Need ONNX/TensorRT/NCNN?** First prove the base AdelaiDet install, then switch to `export-convert` for optional deployment runtimes.6162## Success signal6364A healthy CUDA-capable environment reports:6566- `import adet` succeeds.67- `adet._C` exposes BezierAlign, DefROIAlign, and `ml_nms` symbols.68- `scripts/check_install.py --cuda-ops` exits 0.69- CLI help for training/demo/visualization/export can import all required modules.