计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
training【效率与协作】Use Tensorpack ModelDesc, TrainConfig, trainers, callbacks, summaries, layers, and example training recipes.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when a task needs Tensorpack graph training: defining a
ModelDesc, choosing a trainer, configuring TrainConfig, composing callbacks
and monitors, using Tensorpack symbolic layers, adapting known training recipes,
or debugging TF1-compatible tower training.
ModelDesc, ModelDescBase, inputs(), build_graph(),
optimizer(), TrainConfig, AutoResumeTrainConfig, or
launch_train_with_config.SimpleTrainer,
SyncMultiGPUTrainer, SyncMultiGPUTrainerReplicated,
SyncMultiGPUTrainerParameterServer, AsyncMultiGPUTrainer, distributed
parameter-server/replicated trainers, HorovodTrainer, or BytePS-style
distributed trainers.TowerContext, or multiple calls to
the same tower function.ModelSaver, InferenceRunner,
ScalarStats, ClassificationError, ScheduledHyperParamSetter,
MaxSaver, MinSaver, MergeAllSummaries, TensorBoard event files,
JSON histories, scalar printing, progress bars, or update ops.tf.summary.*,
summary.add_moving_summary, summary.add_param_summary, moving averages,
default monitors, or logging into TensorBoard/JSON/stdout.Conv2D,
FullyConnected, BatchNorm, argscope, LinearWrap, regularize_cost,
BNReLU, pooling layers, dropout, or caveats around tf.layers/Keras.MultiProcessRunnerZMQ, route to
../dataflow/SKILL.md.PredictConfig, OfflinePredictor, checkpoint
variable inspection, .npz model-zoo files, Serving export, compact frozen
graphs, or Caffe conversion, route to
../inference-export/SKILL.md.ModelDesc + TrainConfig for
single-cost gradient training. Use the raw trainer interface when callbacks
must be constructed after graph setup or the iteration is not single-cost.inputs() should return a list of
tf.TensorSpec or placeholders created inside inputs(). The order and
names must match the datapoints yielded by the input source.build_graph() is a tower function: it may be
called once per GPU and again for inference. Use tf.get_variable, respect
the enclosing variable scope, avoid global-state mutation, and return the
final cost for ModelDesc training.optimizer() must return a
tf.train.Optimizer. If using scheduled learning rates, create a named,
non-trainable variable such as learning_rate and target it from callbacks.SimpleTrainer for CPU or one
local GPU. Use synchronized multi-GPU trainers for data-parallel SGD, async
trainers for intentionally asynchronous updates, and Horovod/BytePS only when
the launcher, dependency, and log-directory behavior are controlled.steps_per_epoch deliberately. Tensorpack epochs mainly schedule
callbacks. If input size is not known, set TrainConfig(steps_per_epoch=...).
For multi-GPU, remember each GPU consumes one input batch, so total batch size
is per-tower batch times the number of towers..npz loading
in TrainConfig(session_init=...) or AutoResumeTrainConfig; route variable
inspection/export details to inference-export.The helper scripts/minimal_training_smoke.py is a safe, fake-data training script adapted for the generated skill tree. It has no network or dataset dependency and is intended for parser/help checks or a very short one-epoch run:
python scripts/minimal_training_smoke.py --workdir /tmp/tensorpack-smoke --steps-per-epoch 2 --max-epoch 1
Use it to demonstrate the shape of a Tensorpack ModelDesc, TrainConfig,
callbacks, summaries, and trainer launch. Do not use it as evidence that a
real dataset, GPU backend, Horovod, or paper benchmark is reproducible.
inputs(), build_graph(), and optimizer().steps_per_epoch; use
references/troubleshooting.md.tensorpack.tfv1 / tf.compat.v1 style graph code and disable eager execution
before graph construction when needed.