Implementation:Tensorflow Serving SavedModel Download
| Knowledge Sources | |
|---|---|
| Domains | Data_Preparation, Deployment |
| Last Updated | 2026-02-13 17:00 GMT |
Overview
Concrete tool for downloading and extracting pre-trained SavedModels from TensorFlow Hub or other sources for Kubernetes deployment.
Description
The TensorFlow Serving Kubernetes tutorial demonstrates downloading a ResNet model from TensorFlow Hub using wget and tar. The model archive is extracted into a versioned directory (/tmp/resnet/123/) where 123 is an arbitrary version number.
This is an external tool documentation — the implementation uses standard Unix commands rather than a repository API.
Usage
Use this when deploying a pre-trained model from TensorFlow Hub. For custom models, use SavedModelBuilder export instead.
Code Reference
Source Location
- Repository: tensorflow/serving
- File: tensorflow_serving/g3doc/serving_kubernetes.md (L27-43)
Signature
# Download model from TF Hub
wget "https://tfhub.dev/tensorflow/resnet_50/classification/1?tf-hub-format=compressed" \
-O /tmp/resnet.tar.gz
# Extract into versioned directory
mkdir -p /tmp/resnet/123
tar xvfz /tmp/resnet.tar.gz -C /tmp/resnet/123/
Import
# Shell commands — no code import needed
# Requires: wget, tar, mkdir
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| Model URL | string | Yes | TF Hub URL or other model download URL |
| Version number | integer | Yes | Version directory name (e.g., 123) |
| Base path | string | Yes | Local directory for model storage |
Outputs
| Name | Type | Description |
|---|---|---|
| SavedModel directory | Directory | <base_path>/<version>/ containing saved_model.pb and variables/ |
Usage Examples
Download ResNet from TF Hub
# Download and extract
mkdir -p /tmp/resnet/123
wget "https://tfhub.dev/tensorflow/resnet_50/classification/1?tf-hub-format=compressed" \
-O /tmp/resnet.tar.gz
tar xvfz /tmp/resnet.tar.gz -C /tmp/resnet/123/
# Verify structure
ls /tmp/resnet/123/
# Output: saved_model.pb variables/