ResourceExhaustedError while using EfficientNet in keras

Viewed 351

I am using google colab. While using EfficientNetB3 i am getting the following error
Resource exhausted: OOM when allocating tensor with shape[15,95,95,192] and type float

I understand this because my data does not fit in GPU. But when I try InceptionResNetV2 i did not get any error.

Number of trainable parameters in EfficientNetB3 is 22,220,824
Number of trainable parameters in InceptionResNetV2 is 109,380,744

Number of trainable parameters in InceptionResNetV2 are 5 time more than EfficientNetB3. So I am expecting InceptionResNetV2to throw error not EfficientNetB3.

Any idea why I am getting resource error in EfficientNetB3?

Note: I am using two parallel networks and these parameters are the sum of both network's parameters.

1 Answers

All the papers seem be using TPUs to run the efficientNets. I have a feeling there is something else that is making it use far more memory. I agree it isn't intuitive since there is less training params in efficientNets. However, it does seem you need to actually be using TPUs to do it. So basically this would require using some cloud service that gives you access to TPUs ect...

Related