model-inference
Set up iGAN pretrained DCGAN artifacts, choose model zoo entries, build sample-generation commands, and use dcgan_theano.Model API facts safely.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- model-inference
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Set up iGAN pretrained DCGAN artifacts, choose model zoo entries, build sample-generation commands, and use dcgan_theano.Model API facts safely.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/api-reference.md6.4 KB
- 参考文档references/model-workflows.md7.3 KB
- 参考文档references/troubleshooting.md7.8 KB
- 脚本scripts/build_model_command.py6.7 KB
- 脚本scripts/igan_artifact_urls.py5.3 KB
03 SKILL.md 正文
model-inference
Use this sub-skill when the task is about loading or selecting iGAN pretrained
DCGAN models, planning model artifact downloads, building the standalone sample
command, or understanding the dcgan_theano.Model inference API without opening
the source checkout.
Route here
- Choose among the iGAN pretrained DCGAN model zoo entries.
- Plan where a
*.dcgan_theanomodel file should live before running iGAN. - Build a safe command for random sample generation from a pretrained model.
- Diagnose missing model artifacts before launching GPU/Theano code.
- Explain
dcgan_theano.Modelconstruction, generation, transforms, and output shapes. - Preserve model URL and target-path evidence without performing network access.
Route elsewhere
- Interactive PyQt4 drawing, sliders, candidate panes, ShadowDraw UI, or launch flags belong in interactive-ui.
- Color-map, mask, edge-map, or headless constrained generation workflows belong in constraint-generation.
- Image-to-latent projection, AlexNet artifacts,
cnn,opt, orcnn_optsolvers belong in image-projection. - Dataset creation, HDF5 files, DCGAN training, batchnorm estimation, predictor training, and model packing belong in training-data.
Core facts
- The inference model type used by this repo is
dcgan_theano. - The default model file convention is
./models/<model_name>.dcgan_theano. - The sample workflow emits a grid image, defaulting to
<model_name>_dcgan_theano_samples.png. - The documented sample run generates
196images in batches of49, then arranges them as a14 x 14grid. - Full native execution assumes a legacy Python2-era Theano CUDA/cuDNN stack plus OpenCV and a downloaded model file. Command building and URL planning are safe dry-run operations and do not validate GPU execution.
- All bundled scripts in this sub-skill are side-effect safe by default: they do not import Theano, train models, use a GPU, or download files.
Model zoo names
Use one of these canonical pretrained names unless you intentionally add a new compatible config and model artifact:
| Model name | Channels | Notes |
|---|---|---|
outdoor_64 |
3 | 64x64 landscape model. |
church_64 |
3 | 64x64 LSUN church model. |
handbag_64 |
3 | 64x64 handbag model. |
shoes_64 |
3 | 64x64 shoe-photo model. |
hed_shoes_64 |
1 | 64x64 shoe-sketch/HED model; often paired with UI shadow mode. |
For architecture and transform details, read references/api-reference.md. For model setup and sample workflows, read references/model-workflows.md.
Standard workflow
- Select the model name from the model zoo.
- Use the artifact planner to confirm the public URL and expected target path.
- Download or stage the model artifact outside the helper if network access and storage are explicitly allowed.
- Build the sample-generation command using the command builder.
- If a legacy runtime is available, run the generated command with appropriate
THEANO_FLAGS; otherwise keep the command as a reproducible handoff. - If native execution fails, consult references/troubleshooting.md and the root troubleshooting reference when the issue is cross-cutting.
Bundled helpers
scripts/igan_artifact_urls.pyprints the model artifact URL, expected target path, optional preview-sample URLs, and a missing/present status check. It does not download or modify files.scripts/build_model_command.pyprints a reproducible command and environment plan equivalent to the standalone sample script. It can also report whether the planned model file is currently present.
Example dry plan for a missing artifact:
python sub-skills/model-inference/scripts/igan_artifact_urls.py outdoor_64 --check-existing
Example dry sample command with explicit paths:
python sub-skills/model-inference/scripts/build_model_command.py \
--model_name shoes_64 \
--model_file models/shoes_64.dcgan_theano \
--output_image outputs/shoes_grid.png \
--check-model
Validation signals
A healthy dry-run handoff includes:
model_namematches a known model-zoo/config entry or the user explicitly allowed a custom name.model_typeisdcgan_theanounless the task is about extending the backend.- The model target ends with
.dcgan_theanoand follows the default convention unless a custom file is supplied. - The command includes
THEANO_FLAGSfor GPU use or clearly states that flags were intentionally omitted. --check-modelreportspresentbefore actual generation, or reportsmissingwith the artifact planner command needed to obtain the URL.
Native execution caveat
The original sample workflow is a valuable native verification candidate, but it is not a safe default check. It imports Theano, compiles a generator, loads a pickle-like model file, uses CUDA/cuDNN in the documented setup, imports OpenCV, and writes an image. Treat successful dry command generation as static planning, not proof that the legacy model can run on the current machine.
Troubleshooting first steps
- Missing model file: run the artifact planner and stage the exact
<model_name>.dcgan_theanotarget. - Unknown model name: compare with the model zoo table and the config table in references/api-reference.md.
- Import or compile failures: check the legacy stack matrix in references/troubleshooting.md.
- Color/channel surprises for
hed_shoes_64: verify that downstream workflows expect a one-channel model and route UI shadow behavior to the UI sub-skill.
Output contract for future agents
When asked to produce a model-inference handoff, return the chosen model name, model type, planned model file, artifact URL and target, command/env plan, expected output image, whether the file exists, whether native execution was actually attempted, and unresolved runtime blockers. Do not claim a download, GPU compile, or sample image was produced unless that command was explicitly run and verified.
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).