PMLE Scaling Prototypes into ML Models Practice Question
You are deploying a scikit-learn model to Vertex AI for online prediction. The model was trained on a dataset with numerical features and expects input data in a specific JSON format. You have created a custom container that serves the model using a Flask app. After deploying the model to a Vertex AI Endpoint, you send a prediction request with a JSON payload, but the response is an error indicating that the input format is invalid. What is the most likely reason for this error?
⚠ Common exam trap
The trap here is assuming that Vertex AI automatically transforms the input for scikit-learn, when in fact the custom container is fully responsible for parsing and preprocessing the request.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The custom container's Flask app does not parse the incoming JSON correctly because it expects a different key or structure than what was sent.
The correct answer is that the custom container's Flask app does not parse the incoming JSON correctly. Vertex AI passes the raw request to the container, so the container must implement logic to extract and format the input as expected by the model. If the JSON structure sent by the client does not match what the container expects, an input format error occurs. Ensuring alignment between the client request and container preprocessing is essential.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
The custom container's Flask app does not parse the incoming JSON correctly because it expects a different key or structure than what was sent.
Why this is correct
When you deploy a custom container, the prediction request payload is passed to your container as-is. If your Flask app expects a specific JSON schema (e.g., a key named 'instances' or 'data'), but you send a different structure, it will fail to parse the input. This is a common mistake when the container's preprocessing logic does not match the request format.
- ✗
The Vertex AI Endpoint requires the input data to be base64-encoded.
Why it's wrong here
Vertex AI online prediction accepts JSON payloads directly for custom containers. Base64 encoding is not a general requirement; it is sometimes used for binary data, but not for standard JSON. The error indicates an input format issue, which is more likely due to a mismatch between the expected and provided JSON structure.
- ✗
The Vertex AI Endpoint automatically converts the input to a TensorFlow tensor, which is incompatible with scikit-learn models.
Why it's wrong here
Vertex AI does not automatically convert input to TensorFlow tensors for custom containers. The container receives the raw request body and must handle it according to its own logic. This option incorrectly assumes an automatic conversion that does not occur, leading to confusion about the source of the error.
- ✗
The model artifact was not uploaded to Cloud Storage, so the container cannot load the model and returns an input format error.
Why it's wrong here
If the model artifact were missing, the container would likely fail to start or return a different error, such as a model loading error. An input format error specifically points to a problem with the prediction request payload, not the model artifact. The container must have successfully loaded the model to reach the prediction logic.
Go deeper
Related to this question
About these practice questions
One of 775 original PMLE practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Google Cloud exam blueprint
This PMLE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PMLE exam.