Courseiva
mediumMultiple Choice

PMLE Practice Question: A data scientist deployed a TensorFlow model for…

Exhibit

Refer to the exhibit.
```
Error: INVALID_ARGUMENT: Model 'projects/my-project/models/sentiment_v2' failed to load. The model's signature definition does not match the prediction request.
Expected: input: 'text' (string), output: 'scores' (float array)
Received: input: 'review_text' (string)
```

A data scientist deployed a TensorFlow model for sentiment analysis to Vertex AI Prediction. The model expects input key 'text' but the client sends requests with key 'review_text'. Which step should the data scientist take to resolve the error without retraining the model?

⚠ Common exam trap

Google Cloud often tests the misconception that you need to add infrastructure (like Cloud Functions) or modify the model to handle input key mismatches, when the correct answer is to adjust the client code to match the model's expected input schema.

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

✓

Modify the client code to send requests with input key 'text'

The most straightforward and reliable solution is to modify the client code to send the request with the expected input key 'text'. This avoids any additional infrastructure, latency, or complexity, and does not require retraining the model or altering the deployed endpoint. Vertex AI Prediction serves the model as-is, so aligning the client's request format with the model's expected input is the simplest and most maintainable fix.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Use a Cloud Function to strip the 'review_text' key and replace it with 'text'

    Why it's wrong here

    A Cloud Function can transform request payloads, but it introduces an additional network hop and latency, and the question explicitly requires resolving the error without retraining the model—not without modifying infrastructure. This option is tempting because Cloud Functions are commonly used for lightweight data transformation between services, and in a scenario where the client cannot change its request format and the model cannot be retrained, a middleware function would be a valid architectural fix. However, Vertex AI Prediction natively supports input aliasing via the `predict` method's `instances` field, which allows mapping `review_text` to `text` at the endpoint level, avoiding any extra component.

  • ✗

    Retrain the model with input key 'review_text'

    Why it's wrong here

    Retraining alters learned weights, not the serving input contract, so the key mismatch persists and wastes compute. It is tempting because retraining with 'review_text' examples would align the signature, which is correct only when the model itself must learn new patterns rather than accept a renamed field.

  • ✗

    Create a new Vertex AI Endpoint with an alias mapping 'review_text' to 'text'

    Why it's wrong here

    Vertex AI Endpoints do not support alias mapping between request keys; input transformation belongs in the model's serving signature or a preprocessing layer. It is tempting because endpoint aliases exist for traffic splitting between model versions, and would be correct for canary deployment rather than request-field renaming.

  • ✓

    Modify the client code to send requests with input key 'text'

    Why this is correct

    Vertex AI Prediction validates incoming instances against the model's signature, which expects the key 'text'. Renaming the client payload key from 'review_text' to 'text' aligns the request with that signature, resolving the error without retraining or altering the model.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

About these practice questions

Courseiva writes every PMLE question from scratch — 775 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.