Q: 6
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 224x224
• 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?
Options
Discussion
B tbh, since batch size eats up a lot of GPU memory fast. D might be tempting but you'd lose image detail for IDs, so not ideal here. Saw a similar question in practice and B was correct. Trap is thinking optimizer or learning rate helps!
Reducing batch size (B) is usually the first thing to try for a ResourceExhaustedError since it scales down tensor allocations pretty quickly. Lowering image shape (D) works too but risks losing critical features in ID images. Pretty sure B is expected, unless resolution drops are acceptable. Agree?
Why not D? Smaller image shape means less memory per input, might solve OOM too.
Guessing B here. Batch size directly impacts GPU memory usage, so that's usually the first thing to drop if you see ResourceExhaustedError. Saw a similar question on a practice exam and B was right. Anyone disagree?
Its B, batch size directly impacts GPU memory use. Seen this error before, lowering batch size fixes it fast. Agree?
Be respectful. No spam.