技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
tensorflow-project-template【数据与研究】Guides agents in adapting TensorFlow Project Template training-project structure, configs, models, trainers, data loaders, TensorBoard logging, checkpoints, and safe smoke checks.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this skill when the task is to understand, copy, modernize, debug, or extend the Tensorflow-Project-Template style of TensorFlow project: a model class, trainer class, data generator, JSON config, TensorBoard logger, checkpoint saver, and one main entry point wired together.
This repository is a small template, not an installable Python distribution. Treat it as project skeleton guidance: place the project root on PYTHONPATH or run from a checkout/copy of the template when validating code.
| User intent | Use this skill content |
|---|---|
| "How do I add my own model/trainer?" | Read extension workflow, then check API contracts in API reference. |
| "What config keys and paths does it expect?" | Read configuration. |
| "Why does import/training/logging/checkpointing fail?" | Read troubleshooting, then run scripts/check_template_static.py. |
| "Can this copied template still run?" | Run scripts/check_template_static.py; if TensorFlow 1.x is installed, run scripts/run_tiny_training_smoke.py. |
| "Is this skill current for my checkout?" | Read repository provenance. |
tf.Session, tf.placeholder, tf.variable_scope, tf.assign, tf.layers.dense, tf.train.Saver, and tf.summary.FileWriter.tensorflow==1.15.5, numpy<1.19, tqdm, bunch, and protobuf<3.20.tf.compat.v1 or a full Keras rewrite; do not assume the original files run unchanged.Logger implementation has no Comet import or API call.From this generated skill directory, validate a target checkout or copied project:
python scripts/check_template_static.py --repo-root /path/to/template-copy
If the environment has TensorFlow 1.x-compatible APIs, run a bounded one-step smoke:
python scripts/run_tiny_training_smoke.py --repo-root /path/to/template-copy --work-dir /path/to/safe-smoke-workdir
Both scripts are self-contained skill helpers. They accept an explicit target project path; they do not depend on the original source checkout used to create this skill.
base/BaseModel owns shared checkpoint, current-epoch, and global-step behavior. A child model must implement build_model() and init_saver().models/ExampleModel shows a TF1 graph with placeholders, dense layers, cross-entropy loss, Adam optimizer, accuracy, and a saver.base/BaseTrain owns session initialization and epoch looping. A child trainer must implement train_epoch() and train_step().trainers/ExampleTrainer fetches batches from DataGenerator, runs the model train op, summarizes averaged loss/accuracy, and saves a checkpoint each epoch.data_loader/DataGenerator is deliberately minimal; replace it with project-specific dataset loading while preserving the next_batch(batch_size) contract or update the trainer accordingly.utils/config.process_config() reads a JSON config and derives summary_dir and checkpoint_dir under ../experiments/<exp_name>/ relative to the current process.mains/example.py wires config parsing, directory creation, session, data, model, logger, trainer, checkpoint load, and trainer.train().x shaped [batch, 784] and labels shaped [batch, 10].scripts/check_template_static.py validates template files, class hooks, config keys, and TF1 symbol usage without importing TensorFlow.scripts/run_tiny_training_smoke.py runs an optional one-step training smoke against a target template copy when a TF1-compatible runtime is available.