技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
dataflow【数据与研究】Use Tensorpack DataFlow, datasets, augmentors, serializers, input sources, and performance-tuning utilities.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when the user needs Tensorpack data loading, preprocessing, serialization, image augmentation, TensorFlow input-source bridging, or data pipeline performance diagnosis. Keep answers self-contained: rely on the bundled references and script here instead of reopening the original repository.
references/api-reference.md.references/workflows.md.references/troubleshooting.md.scripts/dataflow_serializer_smoke.py.tensorpack.dataflow, DataFlow, datapoints, components,
reset_state(), __iter__(), BatchData, MapData, MapDataComponent,
FakeData, DataFromList, DataFromGenerator, RepeatedData, or PrintData.LMDBSerializer, NumpySerializer, TFRecordSerializer,
HDF5Serializer, optional serializer imports, or a data serialization
roundtrip.tensorpack.dataflow.imgaug, AugmentorList, deterministic
image transforms, coordinate transforms, Flip, Resize, CenterCrop,
GoogleNetRandomCropAndResize, dtype conversions, contrast, or brightness.FeedInput,
QueueInput, StagingInput, TFDatasetInput, TensorInput, or ZMQInput.Mnist, Cifar10,
SVHNDigit, ILSVRC12, or ILSVRC12Files.TestDataSpeed, random disk reads, CPU-bound
augmentation, network/IPC bottlenecks, or slow input pipelines.../training/SKILL.md..npz model-zoo variables,
and checkpoint inspection belong in
../inference-export/SKILL.md.../../references/examples-catalog.md
and ../training/references/example-recipes.md.Tensorpack DataFlow is a pure-Python iterator system. A source DataFlow yields
one datapoint at a time; wrappers transform, filter, batch, shuffle, prefetch,
or serialize those datapoints. A datapoint is normally a list of components, but
some DataFlow utilities also support dict datapoints. Tensorpack trainers do not
usually consume DataFlow directly; an InputSource turns a DataFlow or another
input producer into tensors in the TensorFlow graph.
Default answer pattern:
__iter__(), call reset_state() in
the process that will iterate, treat __len__() as optional/rough unless the
downstream consumer needs exact size, and avoid concurrent iteration of one
non-reentrant instance.PrintData and TestDataSpeed before guessing. If a trainer queue is
close to empty, diagnose the input pipeline; if it is full, route graph or
trainer speed questions to training.DataFlow or wrap a generator with
DataFromGenerator; then compose maps, augmentors, batches, and prefetching.FakeData or DataFromList.MapDataComponent(ds, func, index=...); map/filter a
full datapoint: use MapData(ds, func), returning None to drop it.BatchData(ds, batch_size); use
use_list=True when components have variable shapes such as raw images.MultiProcessRunnerZMQ or MultiThreadRunner only when duplicated/reordered
i.i.d. samples are acceptable.MultiThreadMapData or MultiProcessMapData/MultiProcessMapDataZMQ; use
strict=True for finite validation-style passes, remembering order is still
not preserved.QueueInput(dataflow) for most DataFlow
training; wrap with StagingInput when GPU staging is useful; use
TFDatasetInput or TensorInput for TensorFlow-native input pipelines.references/workflows.md#custom-source-dataflow
and the DataFlow section of
references/api-reference.md#dataflow-object-contract.references/workflows.md#compose-maps-batches-and-debug-prints.references/workflows.md#parallelism-decision-tree.references/workflows.md#serialization-roundtrips
and the bundled smoke script.references/workflows.md#imagenet-style-pipelines.references/workflows.md#timit-style-lmdb-pattern.references/workflows.md#inputsource-bridge-to-trainers.references/workflows.md#performance-diagnosis
and references/troubleshooting.md#slow-or-empty-queues.Use the bundled script for serializer availability, optional dependency messages, and tiny deterministic roundtrips:
python sub-skills/dataflow/scripts/dataflow_serializer_smoke.py --help
python sub-skills/dataflow/scripts/dataflow_serializer_smoke.py \
--workdir <scratch-dir> --formats numpy
python sub-skills/dataflow/scripts/dataflow_serializer_smoke.py \
--workdir <scratch-dir> --formats all
The script writes only under --workdir, uses tiny synthetic datapoints, avoids
network and downloads, and does not require original Tensorpack source files.