hardMultiple Select
PMLE Practice Question: A company trains a model using Vertex AI Training…
A company trains a model using Vertex AI Training and then deploys it to Vertex AI Prediction. They notice that prediction requests fail with 'InvalidArgument: input tensor shape mismatch'. Which THREE are possible causes?
⚠ Common exam trap
Google Cloud often tests the misconception that 'shape mismatch' only refers to the number of features or dimensions, when in fact it also encompasses data type mismatches and preprocessing inconsistencies that alter the tensor structure before it reaches the model.
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 input data types do not match the expected types (e.g., float vs int)
Option C is correct because Vertex AI Prediction validates request tensors against the model's signature, and a dtype mismatch such as sending int32 where the signature expects float32 raises InvalidArgument due to incompatible tensor types. Option D is correct because the input tensor's feature dimension must match the model's expected input shape; supplying a different number of features produces the shape mismatch error. Option E is correct because if the serving function omits the preprocessing applied during training (for example, normalization, tokenization, or reshaping), the raw request tensor will not match the shape the model's signature expects, triggering the same error. Option A is not the cause here because an unsupported export format would typically fail at model upload or deployment with a format/import error rather than at prediction time with a tensor shape mismatch. Option B is not the cause because an oversized batch size generally results in resource or memory errors, not an InvalidArgument tensor shape mismatch.
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 model was exported in a different format than supported
Why it's wrong here
Export format affects whether Vertex AI can load the model at all, producing load or import errors rather than a runtime tensor shape mismatch on prediction. It is tempting because format compatibility is genuinely required, and would be the cause if deployment failed with an unsupported artefact error.
- ✗
The batch size in the request is too large
Why it's wrong here
Batch size alters the leading dimension, not the tensor rank or feature dimensions the model expects, so an oversized batch typically triggers a resource error rather than a shape mismatch. It tempts because batching is a common tuning concern, and reducing batch size is the correct fix when requests exceed memory limits or per-request quotas.
- ✓
The input data types do not match the expected types (e.g., float vs int)
Why this is correct
Tensor shape validation includes dtype checking, so passing float32 where the model signature expects int32 raises InvalidArgument before inference. The declared input schema fixes each tensor's dtype, and a mismatch is reported as a shape error rather than a type error.
- ✓
The input data has a different number of features than the model expects
Why this is correct
The model's input signature fixes the feature dimension, so a request supplying a different number of features produces a tensor whose shape cannot be matched to the expected placeholder. Vertex AI rejects it with InvalidArgument: input tensor shape mismatch before any prediction runs.
- ✓
The serving function does not include the same preprocessing as training
Why this is correct
Preprocessing applied during training transforms raw features into the model's expected tensor layout. If the serving function omits that step, raw inputs reach the model with the wrong dimensions, triggering the shape-mismatch error at prediction time.
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 by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.