training
Guides command-line stylegan2_pytorch training, checkpoint resume/restart, image generation, interpolation, augmentation, logging, and CUDA troubleshooting.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- training
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Guides command-line stylegan2_pytorch training, checkpoint resume/restart, image generation, interpolation, augmentation, logging, and CUDA troubleshooting.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/cli-reference.md5.4 KB
- 参考文档references/data-layout.md3.1 KB
- 参考文档references/troubleshooting.md4.5 KB
- 参考文档references/workflows.md6.2 KB
- 脚本scripts/make_tiny_fixture.py3.2 KB
- 脚本scripts/train_smoke.py5.5 KB
03 SKILL.md 正文
Training and CLI Workflows
Use this sub-skill for the installed stylegan2_pytorch command. It covers
training from image folders, checkpoint behavior, sample generation,
interpolation GIFs, low-data augmentation, optional logging/FID features,
transparent images, and memory/backend choices.
Start here
- Confirm the package imports and CUDA is available with the root checker:
../../scripts/check_install.py. - Read references/data-layout.md before building a command, especially when the user's data folder may be empty, nested, or have unsupported file extensions.
- Use references/cli-reference.md to translate user intent into exact CLI flags and defaults.
- Use references/workflows.md for complete recipes: new training, resume/restart, generation, interpolation, FID/logging, and multi-GPU variants.
- Use references/troubleshooting.md when the command fails, diverges, runs out of memory, cannot find images, cannot load a checkpoint, or hits an optional dependency issue.
Common task routes
- Train a new model: choose
--data,--name,--image_size,--batch_size,--gradient_accumulate_every,--network_capacity, output directories, and whether--newis needed. - Resume training: keep the same project
--nameand output directories; omit--newso the latestmodel_<n>.ptis loaded. - Restart with changed architecture/data settings: add
--newand make the output path decision explicit because the command clears the existing project model/results directories. - Generate still samples: run with
--generateafter a checkpoint exists; use--load_fromand--trunc_psiwhen the user requests a specific checkpoint or truncation. - Generate interpolation: run with
--generate_interpolation, tune--interpolation_num_steps, and add--save_framesonly when individual frame files are desired. - Low-data training: use
--aug_proband--aug_types; document that supported differentiable augmentation types come from the package's DiffAugment map. - Memory-sensitive training: reduce
--batch_size, raise--gradient_accumulate_every, and lower--network_capacitybefore changing core architecture flags. - Optional add-ons: FID (
--calculate_fid_every) needspytorch-fid; Aim logging (--log) needs an Aim service/UI setup for visualization; Apex fp16 (--fp16) needs a compatible Apex install.
Bundled helper scripts
scripts/make_tiny_fixture.pycreates a small deterministic RGB or RGBA image folder for smoke commands when the user has no safe local fixture.scripts/train_smoke.pywraps the installed CLI with one-step, low-capacity defaults and temporary output directories. Use--dry-runfirst when explaining or reviewing commands; execute it only in a CUDA environment.
Boundaries
- Do not use this sub-skill for Python
ModelLoadercheckpoint sampling; route that to programmatic-api. - Do not use this sub-skill for source-code refactors, release publishing, or general GAN theory detached from this package.
- Do not direct future agents to read or run files from the original repository checkout. Use the installed package command and bundled references/scripts in this skill.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).