技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
tflearn【数据与研究】Use and troubleshoot TFLearn, a TensorFlow-v1-style high-level deep learning API for layers, data feeds, DNN training, checkpoints, and model recipes.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this repo skill when a task names TFLearn, imports tflearn, builds TensorFlow-v1-style graphs with TFLearn layers, prepares TFLearn data feeds, trains with tflearn.DNN/tflearn.Trainer, saves/restores TFLearn checkpoints, or adapts TFLearn example families for small safe experiments.
TFLearn is a legacy high-level API over TensorFlow graph mode. Prefer this skill for package usage, migration triage, compatibility diagnosis, and safe recipe adaptation. Do not use it as a general TensorFlow 2/Keras guide unless the task is specifically about porting or replacing TFLearn code.
Use an isolated legacy environment for runnable TFLearn workflows. A public baseline that matches this skill is Python 3.7.x with TensorFlow 1.15-compatible pins:
python -m pip install "tensorflow==1.15.5" "protobuf==3.20.3" "numpy<1.19" six Pillow
python -m pip install tflearn
TensorFlow 1.15 wheels are not available for many modern Python versions, so create a dedicated Python 3.7 environment rather than trying to retrofit a current Python 3.11+ or 3.13 environment. Install optional packages such as h5py, scipy, dask, pandas, gym, or GPU TensorFlow only when the selected workflow needs them. Read Compatibility before mutating an existing environment.
Read Repository Provenance when checking whether this skill matches a checkout or package version.
Read Compatibility before installing or debugging imports. The verified runtime for this skill is TFLearn 0.5.0 with TensorFlow 1.15.5, NumPy 1.18.x, and protobuf 3.20.x on CPU.
Run the root environment check when a user reports import/runtime trouble:
python scripts/check_tflearn_env.py --help
python scripts/check_tflearn_env.py
Use Troubleshooting for cross-cutting import, graph/session, optional dependency, GPU, and example-safety failures.
For workflows that cross data validation, graph construction, training, and checkpointing, read Integrated Recipes before diving into sub-skills.
| Task signal | Load |
|---|---|
input_data, fully_connected, conv_2d, lstm, merge, regression, activations, losses, metrics, optimizers, variables, summaries, graph collections, shape errors | layers-and-ops |
| CSV/tabular loading, target columns, one-hot labels, sequence padding/vectorization, dataset loaders, HDF5/Dask feeds, image preprocessing, data augmentation | data-input-pipelines |
DNN.fit, prediction/evaluation, validation sets, callbacks, TensorBoard, checkpoints, save/load, get_weights, restore scopes, feed dictionaries | training-and-persistence |
Vision/NLP/generative/RL/recommender recipes, SequenceGenerator, estimators, custom TensorFlow graph with TrainOp/Trainer, shrinking examples to tiny fixtures | advanced-model-recipes |
import tensorflow.compat.v1 as tf
import tflearn
tf.disable_v2_behavior()
with tf.Graph().as_default():
net = tflearn.input_data(shape=[None, 4], name="input")
net = tflearn.fully_connected(net, 8, activation="relu")
net = tflearn.fully_connected(net, 2, activation="softmax")
net = tflearn.regression(net, optimizer="adam", loss="categorical_crossentropy", name="target")
model = tflearn.DNN(net, tensorboard_verbose=0)
For real training, pair the graph with numeric arrays or named feed dictionaries and then use the training sub-skill. Keep one fresh tf.Graph() per independent model rebuild to avoid stale collections.
scripts/check_tflearn_env.py: shared import/version/signature/backend probe.sub-skills/layers-and-ops/scripts/layer_graph_smoke.py: build a tiny graph and inspect collections.sub-skills/data-input-pipelines/scripts/validate_tflearn_tabular_data.py: validate CSV/target/ignore-column plans before load_csv or NumPy conversion.sub-skills/training-and-persistence/scripts/tiny_dnn_regression_smoke.py: train/predict/save/load a tiny DNN regression model without downloads.sub-skills/advanced-model-recipes/scripts/custom_trainer_smoke.py: train a custom TensorFlow graph through tflearn.TrainOp and tflearn.Trainer on tiny arrays.