
Answer-first summary for fast verification
Answer: Decrease the batch size to 32 to reduce the memory footprint during training.
Decreasing the batch size is the most effective way to resolve an OOM error because it directly reduces the amount of memory required for training by lowering the size of the tensors allocated during each iteration. This adjustment allows the training to proceed without exceeding the GPU's memory limits, while other changes like altering the optimizer or image shape might affect the model's performance or accuracy.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You are training a computer vision model on a GPU-powered virtual machine in Compute Engine to classify government ID types from images. The model uses SGD as the optimizer, with an image shape of 224x224, a batch size of 64, and is set to run for 10 epochs with a verbose of 2. During training, you encounter an 'Out of Memory (OOM)' error. Considering the need to maintain model accuracy while resolving the OOM error, which of the following adjustments should you prioritize? (Choose one correct option)
A
Adjust the learning rate to a lower value to reduce memory usage.
B
Decrease the image shape to 112x112 to reduce the input size.
C
Switch from SGD to Adam optimizer for more efficient memory usage.
D
Decrease the batch size to 32 to reduce the memory footprint during training.
No comments yet.