Google Professional Machine Learning Engineer exam dumps

Google Professional Machine Learning Engineer practice question 308 of 522

Professional Machine Learning Engineer. Professional level, Google Cloud. Free question with the correct answer and a full explanation.

Google Professional Machine Learning Engineer Question 308

Single answerGoogle Cloud Platform

You are tasked with deploying a machine learning model built using PyTorch for a production environment on Google Cloud. The model must serve real-time predictions and needs to be scalable to handle fluctuating traffic. Which of the following approaches should you use to efficiently serve the model?

  1. A

    Export the PyTorch model to TorchScript, containerize it with a custom Docker image, and deploy it on Cloud Run.

  2. B

    Directly deploy the PyTorch model to Vertex AI Model Registry without any modifications and use Vertex AI Prediction service to serve it.

  3. C

    Convert the PyTorch model to TensorFlow SavedModel format and deploy it using TensorFlow Serving on Google Kubernetes Engine (GKE).

  4. D

    Use TensorFlow Lite to optimize the PyTorch model and deploy it for real-time inference using Edge TPU.

Show answer and explanation

Correct answer: A

Explanation

Exporting a PyTorch model to TorchScript allows for efficient inference and compatibility with various serving solutions. Deploying it on Cloud Run provides a serverless, auto-scaling environment ideal for real-time predictions. This approach ensures both ease of deployment and scalability, making it the most appropriate solution given the requirements.

  • A. Correct.

    This is the correct approach because exporting the PyTorch model to TorchScript makes it more portable and efficient for serving. Containerizing the model with a custom Docker image and deploying it on Cloud Run ensures scalability and support for real-time predictions, leveraging Google Cloud's serverless infrastructure.

  • B. Incorrect.

    This option is incorrect because Vertex AI Model Registry does not natively support serving PyTorch models directly without modifications. You would need to convert or package the model appropriately before using Vertex AI Prediction.

  • C. Incorrect.

    This option is incorrect because converting a PyTorch model to TensorFlow SavedModel format introduces complexity and potential compatibility issues. TensorFlow Serving is also unnecessary when PyTorch-native tools can be used.

  • D. Incorrect.

    This option is incorrect because TensorFlow Lite and Edge TPU are designed for optimized inference on edge devices, which is not suitable for scalable real-time predictions in a cloud environment.

Timed practice exam

Take a Google Professional Machine Learning Engineer practice test under exam conditions

60 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam