Deploy pre-trained Inception in TensorflowServing fails SavedModel has no variables
ML System Design practice on Codemia
Design recommenders, ranking systems and training pipelines the way ML interviews actually ask for them, with worked solutions.
Introduction
When TensorFlow Serving refuses to load a pre-trained Inception export with a message about the SavedModel having no variables, the real issue is usually that the artifact is not the kind of SavedModel TensorFlow Serving expects. Many pre-trained model downloads give you checkpoints, frozen graphs, or partially exported files, but TensorFlow Serving needs a proper versioned SavedModel with usable signatures and a complete inference graph.
Know the Difference Between Model Artifacts
This confusion comes from the fact that TensorFlow model files are not all interchangeable.
Common artifact types include:
- checkpoint files, which store variable values
- frozen graphs, where weights are baked into constants
- SavedModel exports, which package graph plus signatures for serving
TensorFlow Serving wants a model directory shaped like this:
Sometimes the variables/ directory may be empty or absent for a constant-only export, but the bigger point is that the artifact must still be a real SavedModel with valid serving signatures. Copying a graph file into a directory is not enough.
Why Inception Downloads Commonly Cause Trouble
Pre-trained Inception packages are often published for training or fine-tuning workflows, not for direct TensorFlow Serving deployment. For example, a download may contain:
- checkpoint shards
- label files
- graph definitions
That does not automatically mean you have a serving-ready export. If you point TensorFlow Serving at the wrong directory, it may complain about missing variables or fail to find a valid servable graph.
Export a Real SavedModel
The safest solution is to export the model explicitly for serving.
A minimal TensorFlow 2 style example looks like this:
That creates a serving-oriented export rather than relying on whatever layout the original download happened to use.
Check the SavedModel Before Serving
Before starting TensorFlow Serving, inspect the export:
This helps you verify:
- the directory really is a SavedModel
- the signature exists
- the input and output tensor names make sense
If saved_model_cli cannot describe the model cleanly, TensorFlow Serving is unlikely to load it correctly either.
Frozen Graphs Need Conversion, Not Renaming
A common mistake is taking a frozen graph or checkpoint-based model and assuming it becomes a SavedModel by changing the directory name or copying files around. It does not.
If the original Inception artifact is checkpoint-based, you must:
- rebuild the graph or load the model in TensorFlow
- restore the weights
- export a proper SavedModel for inference
Only then is the result suitable for TensorFlow Serving.
Versioned Directory Layout Matters
Even a valid SavedModel will not be served correctly if the directory layout is wrong. TensorFlow Serving expects:
- a model base path
- one or more numbered subdirectories
Example:
The actual export must live under /models/inception/1, /models/inception/2, and so on. If you point the server directly at the wrong level, load failures become confusing very quickly.
If You Only Have a Checkpoint
For older model code, the workflow is often:
The exact restore code depends on the original model implementation, but the principle is stable: restore first, then export a real SavedModel.
Common Pitfalls
- Treating checkpoints, frozen graphs, and SavedModel exports as if they were interchangeable artifacts.
- Pointing TensorFlow Serving at a pre-trained model download that was never exported for serving in the first place.
- Skipping
saved_model_clivalidation and only discovering export problems when the serving process fails. - Using the wrong directory level instead of the expected versioned model layout.
- Assuming "has no variables" always means the weights are missing, when the deeper issue may be that the artifact is not a valid serving export at all.
Summary
- TensorFlow Serving needs a real SavedModel export with valid signatures and the expected versioned directory structure.
- Many pre-trained Inception downloads are not serving-ready artifacts even though they contain model data.
- The safest path is to load the model in TensorFlow and export it explicitly with
tf.saved_model.save. - Validate the export with
saved_model_clibefore starting TensorFlow Serving. - Most "SavedModel has no variables" failures are really artifact-format problems, not just missing files.
Related reading
- Deploying Keras Models via Google Cloud ML
- DEPRECATION WARNING How to remove tf.keras warning calling VarianceScaling.__init__ with dtype is deprecated...
- Deprecation warnings when using internal Keras library in Tensorflow 1.15.0
- Design patterns for tensorflow models
- Detecting corrupt images in Tensorflow
- Determining if A Value is in a Set in TensorFlow
- Determinism in tensorflow gradient updates?
- Device placement unknown in Tensorboard
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
ML System Design practice on Codemia
Design recommenders, ranking systems and training pipelines the way ML interviews actually ask for them, with worked solutions.