Challenge - 5 Problems
TF Serving Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediateWhat is the primary role of TensorFlow Serving?
TensorFlow Serving is used in production environments. What is its main purpose?
Attempts:
2 left
💡 Hint
Think about what happens after a model is trained and needs to be used by applications.
✗ Incorrect
TensorFlow Serving is designed to deploy and serve models in production, handling multiple versions and providing a stable API for inference.
❓ Predict Output
intermediateWhat output does this TensorFlow Serving REST API request produce?
Given a model served at localhost:8501 with signature 'serving_default', what is the output of this request?
TensorFlow
import requests import json url = 'http://localhost:8501/v1/models/my_model:predict' data = {"instances": [[1.0, 2.0, 3.0]]} response = requests.post(url, json=data) print(response.json())
Attempts:
2 left
💡 Hint
Assume the model is loaded and expects 3 input features, outputting a single prediction.
✗ Incorrect
The request sends input data to the model and receives predictions. Option A shows a typical prediction output format.
❓ Model Choice
advancedWhich model export format is required for TensorFlow Serving?
You want to serve a TensorFlow model using TensorFlow Serving. Which export format must you use?
Attempts:
2 left
💡 Hint
TensorFlow Serving requires a format that includes computation graph and weights.
✗ Incorrect
TensorFlow Serving uses the SavedModel format which contains the model graph, weights, and signatures for serving.
❓ Hyperparameter
advancedWhich TensorFlow Serving configuration parameter controls model version policy?
You want TensorFlow Serving to keep only the latest 3 versions of a model loaded. Which config parameter do you set?
Attempts:
2 left
💡 Hint
Look for the official syntax for version policy in TensorFlow Serving config.
✗ Incorrect
The 'model_version_policy' with 'latest' and 'num_versions' is the correct way to specify how many versions to keep.
🔧 Debug
expertWhy does this TensorFlow Serving gRPC request fail with UNAVAILABLE error?
You run this Python gRPC client code to request predictions but get an UNAVAILABLE error. What is the most likely cause?
TensorFlow
import grpc import tensorflow as tf from tensorflow_serving.apis import prediction_service_pb2_grpc, predict_pb2 channel = grpc.insecure_channel('localhost:8500') stub = prediction_service_pb2_grpc.PredictionServiceStub(channel) request = predict_pb2.PredictRequest() request.model_spec.name = 'my_model' request.model_spec.signature_name = 'serving_default' request.inputs['input_1'].CopyFrom(tf.make_tensor_proto([[1.0, 2.0, 3.0]])) response = stub.Predict(request, timeout=5.0) print(response)
Attempts:
2 left
💡 Hint
UNAVAILABLE usually means the client cannot connect to the server.
✗ Incorrect
The UNAVAILABLE error indicates the server is unreachable, often because TensorFlow Serving is not running or the port is incorrect.
