
Answer-first summary for fast verification
Answer: Reduce the batch size.
The correct answer is B: Reduce the batch size. The ResourceExhaustedError: Out Of Memory (OOM) error indicates that the GPU does not have enough memory to handle the current batch size during training. Reducing the batch size decreases the amount of memory required for each iteration of the training process, thereby preventing the OOM error. Changing the optimizer or the learning rate would not address the memory issue, and although reducing the image shape would also reduce memory usage, it could negatively impact the model's performance. Therefore, adjusting the batch size is the most effective solution.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You are tasked with developing a computer vision model to identify the type of government ID in images. For this, you utilize a GPU-powered virtual machine on Google Cloud's Compute Engine. The specific parameters for the model training are as follows: Optimizer: Stochastic Gradient Descent (SGD), Image shape: 224x224 pixels, Batch size: 64 images, Number of epochs: 10, Verbose level: 2. However, during the training process, you encounter an error message: ResourceExhaustedError: Out Of Memory (OOM) when allocating tensor. What should you do to resolve this issue?
A
Change the optimizer.
B
Reduce the batch size.
C
Change the learning rate.
D
Reduce the image shape.
No comments yet.