tensorflow
Skill15 starsChanged 42 days agoMITView on GitHub
Expert TensorFlow 2.x assistance covering tf.data pipelines, SavedModel serialization, TensorBoard, and multi-GPU distribution strategies. Use when building, training, and deploying production machine learning models.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- tondevrel/scientific-agent-skillstheir own version, first seen Feb 1, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- tondevrel/scientific-agent-skills★ 22same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository350 other files it gives its agents.
- airflowSkill
- catboostSkill
- claudeSkill
- comfyuiSkill
- cursor-aiSkill
- dalleSkill
- daskSkill
- dbtSkill
- deepseekSkill
- fastaiSkill
- geminiSkill
- github-copilotSkill
- huggingfaceSkill
- jaxSkill
- jupyterSkill
- kerasSkill
- langchainSkill
- lightgbmSkill
- llamaindexSkill
- llamaSkill
- matplotlibSkill
- midjourneySkill
- mistralSkill
- mlflowSkill
- nltkSkill
- numpySkill
- ollamaSkill
- openai-gptSkill
- opencvSkill
- pandasSkill
- perplexitySkill
- plotlySkill
- polarsSkill
- pytorchSkill
- raySkill
- scikit-learnSkill
- seabornSkill
- spacySkill
- sparkSkill
- stable-diffusionSkill
- vaexSkill
- weights-biasesSkill
- whisperSkill
- xgboostSkill
- api-gatewaySkill
- clean-architectureSkill
- cqrsSkill
- domain-driven-designSkill
- event-drivenSkill
- event-sourcingSkill
- graphqlSkill
- grpcSkill
- hexagonalSkill
- microservicesSkill
- modular-monolithSkill
- monolithSkill
- rest-apiSkill
- sagaSkill
- serverlessSkill
- service-meshSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 125
Always use num_parallel_calls=tf.data.AUTOTUNE and .prefetch(tf.data.AUTOTUNE) in input pipelines.
- Very specific: line 126
Use tf.distribute.MirroredStrategy for seamless single-node multi-GPU data parallelism.
- Very specific: line 132
Use Python operations inside @tf.function.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
TensorFlow
TensorFlow is an end-to-end open-source machine learning platform with extensive production deployment tooling, Keras integrations, and mobile/embedded optimization via TensorFlow Lite.
When to Use
- Enterprise Production Machine Learning: End-to-end model deployment with TensorFlow Serving and TFX.
- Mobile & Embedded Edge Inference: Compiling models to microcontrollers and mobile apps using TensorFlow Lite (TFLite).
- High-Performance Data Pipelines with tf.data: Prefetching, interleaving, and streaming terabyte-scale datasets.
- Distributed Training Across GPU/TPU Pods: Scaling multi-worker distributed training with
tf.distribute.MirroredStrategy.
Quick Start
import tensorflow as tf
# Define sequential classification model
model = tf.keras.Sequential([
tf.keras.layers.Dense(128, activation='relu', input_shape=(30,)),
tf.keras.layers.Dropout(0.2),
tf.keras.layers.Dense(2, activation='softmax')
])
model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'])Core Concepts
High-Throughput Input Pipelines with tf.data
Asynchronous data loading with prefetching and parallel mapping:
import tensorflow as tf
def parse_image_sample(filename, label):
image_raw = tf.io.read_file(filename)
image = tf.io.decode_jpeg(image_raw, channels=3)
image = tf.image.resize(image, [224, 224])
image = tf.cast(image, tf.float32) / 255.0 # Normalize
return image, label
def create_dataset(filenames, labels, batch_size=64):
dataset = tf.data.Dataset.from_tensor_slices((filenames, labels))
dataset = dataset.shuffle(buffer_size=1000)
# Interleave and map in parallel across all CPU cores
dataset = dataset.map(parse_image_sample, num_parallel_calls=tf.data.AUTOTUNE)
dataset = dataset.batch(batch_size)
# Prefetch batches to GPU memory while current batch trains
dataset = dataset.prefetch(buffer_size=tf.data.AUTOTUNE)
return datasetFunctional Model & Multi-GPU Distribution
Training models across multiple GPUs with MirroredStrategy:
strategy = tf.distribute.MirroredStrategy()
print(f"Number of distributed devices: {strategy.num_replicas_in_sync}")
with strategy.scope():
inputs = tf.keras.Input(shape=(224, 224, 3))
x = tf.keras.layers.Conv2D(32, 3, activation='relu', padding='same')(inputs)
x = tf.keras.layers.MaxPooling2D()(x)
x = tf.keras.layers.Conv2D(64, 3, activation='relu', padding='same')(x)
x = tf.keras.layers.GlobalAveragePooling2D()(x)
outputs = tf.keras.layers.Dense(10, activation='softmax')(x)
model = tf.keras.Model(inputs=inputs, outputs=outputs)
model.compile(
optimizer=tf.keras.optimizers.Adam(learning_rate=1e-3),
loss='sparse_categorical_crossentropy',
metrics=['accuracy']
)
# model.fit(train_dataset, epochs=10)Exporting to TensorFlow Lite (TFLite) with INT8 Quantization
Compressing models for mobile deployment:
converter = tf.lite.TFLiteConverter.from_keras_model(model)
converter.optimizations = [tf.lite.Optimize.DEFAULT]
# Convert model to quantized TFLite binary
tflite_model = converter.convert()
with open("model_quantized.tflite", "wb") as f:
f.write(tflite_model)
print("Saved optimized TFLite model.")Common Patterns
High-Throughput Input Pipelines with tf.data Prefetching
Problem: GPU stays idle waiting for CPU to read, decode, and batch training data.
Solution:
Use tf.data.AUTOTUNE prefetching:
dataset = tf.data.Dataset.from_tensor_slices((X_train, y_train))
dataset = (
dataset.shuffle(buffer_size=10000)
.batch(64)
.prefetch(buffer_size=tf.data.AUTOTUNE) # Overlaps preprocessing with GPU compute
)
model.fit(dataset, epochs=10)Best Practices
Do:
- Always use
num_parallel_calls=tf.data.AUTOTUNEand.prefetch(tf.data.AUTOTUNE)in input pipelines. - Use
tf.distribute.MirroredStrategyfor seamless single-node multi-GPU data parallelism. - Wrap heavy computation inside
@tf.functionto compile graphs via AutoGraph for C++ execution speeds. - Save models in the modern
SavedModelor.kerasformat rather than legacy checkpoint files.
Don't:
- Use Python operations inside
@tf.function; usetf.*operations to ensure clean graph tracing. - Execute feed-dict or session APIs; legacy TensorFlow 1.x patterns are completely deprecated.
- Train on CPU when GPU/TPU acceleration is available; verify devices with
tf.config.list_physical_devices('GPU').
Troubleshooting
| Error | Cause | Solution |
ResourceExhaustedError: OOM when allocating tensor | Batch size or model weights exceed GPU VRAM. | Reduce batch size or configure memory growth: tf.config.experimental.set_memory_growth(gpu, True). |
TensorFlow not detecting GPU | Missing CUDA/cuDNN driver libraries in system library path. | Check detected devices via tf.config.list_physical_devices('GPU'). |
Graph execution error: Incompatible shapes | Input tensor shape mismatch in first model layer. | Verify input batch dimension matches input_shape. |
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

