exam questions

Exam Professional Machine Learning Engineer All Questions

View all questions & answers for the Professional Machine Learning Engineer exam

Exam Professional Machine Learning Engineer topic 1 question 31 discussion

Actual exam question from Google's Professional Machine Learning Engineer
Question #: 31
Topic #: 1
[All Professional Machine Learning Engineer Questions]

You need to train a computer vision model that predicts the type of government ID present in a given image using a GPU-powered virtual machine on Compute
Engine. You use the following parameters:
✑ Optimizer: SGD
✑ Image shape = 224ֳ—224
✑ Batch size = 64
✑ Epochs = 10
✑ Verbose =2
During training you encounter the following error: ResourceExhaustedError: Out Of Memory (OOM) when allocating tensor. What should you do?

  • A. Change the optimizer.
  • B. Reduce the batch size.
  • C. Change the learning rate.
  • D. Reduce the image shape.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
maartenalexander
Highly Voted 3 years, 3 months ago
B. I think you want to reduce batch size. Learning rate and optimizer shouldn't really impact memory utilisation. Decreasing image size (A) would work, but might be costly in terms final performance
upvoted 25 times
...
guruguru
Highly Voted 3 years, 2 months ago
B. https://stackoverflow.com/questions/59394947/how-to-fix-resourceexhaustederror-oom-when-allocating-tensor/59395251#:~:text=OOM%20stands%20for%20%22out%20of,in%20your%20Dense%20%2C%20Conv2D%20layers
upvoted 9 times
...
PhilipKoku
Most Recent 4 months, 1 week ago
Selected Answer: B
B) Reduce the batch size.
upvoted 1 times
...
SamuelTsch
1 year, 3 months ago
Selected Answer: B
no doubt went to B
upvoted 1 times
...
M25
1 year, 5 months ago
Selected Answer: B
Went with B
upvoted 2 times
...
SergioRubiano
1 year, 6 months ago
Selected Answer: B
B is correct
upvoted 1 times
...
Fatiy
1 year, 7 months ago
Selected Answer: B
By reducing the batch size, the amount of memory required for each iteration of the training process is reduced
upvoted 1 times
...
Fatiy
1 year, 7 months ago
Selected Answer: A
Creating alerts to monitor for skew in the input data can help to detect when the distribution of the data has changed and the model's performance is affected. Once a skew is detected, retraining the model with the new data can improve its performance.
upvoted 1 times
Fatiy
1 year, 7 months ago
Sorry it's not the response for this question. it's the response for the previous question.
upvoted 1 times
...
...
John_Pongthorn
1 year, 7 months ago
Selected Answer: B
Reduce the image shape != Reduce the image Size.
upvoted 1 times
...
seifou
1 year, 11 months ago
The answer is B Since you are using an SGD, you can use a batch size of 1 ref: https://stackoverflow.com/questions/63139072/batch-size-for-stochastic-gradient-descent-is-length-of-training-data-and-not-1
upvoted 2 times
...
Mohamed_Mossad
2 years, 4 months ago
Selected Answer: B
to fix memory overflow you need to reduce batch size also reduce input resolution is valid but reducing image size can harm model performance , so answer is B
upvoted 3 times
...
alphard
2 years, 10 months ago
B is my option. But, D seems not wrong. Reducing batch size or reducing image size bot can reduce memory usage. But, the former seems much easier.
upvoted 2 times
...
kaike_reis
2 years, 11 months ago
B is correct. Letter D can be used, as we reduced the image size but this will directly impact the model's performance. Another point is that when doing this, if you are using a model via Keras's `Functional API` you need to change the definition of the input and also apply pre-processing on the image to reduce its size . In other words: much more work than the letter B.
upvoted 3 times
...
mousseUwU
2 years, 12 months ago
B is correct, it uses less memory. A works too but depending on what you need you will loose perfomance (just like maartenalexander said) so I think it is not recommended.
upvoted 3 times
...
george_ognyanov
3 years ago
Initially, I though D. ,decreasing image size, would be the correct one, but now that I am reviewing the test I think maartenalexander is correct in saying reduced image size might decrease final performance, so I'd go with B eventually.
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago