qubvel / efficientnet

Implementation of EfficientNet model. Keras and TensorFlow Keras.
https://arxiv.org/abs/1905.11946
Apache License 2.0
2.07k stars 472 forks source link

ResourceExhaustedError while using EfficientNet #102

Open talhaanwarch opened 4 years ago

talhaanwarch commented 4 years ago

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.

Samjith888 commented 4 years ago

Have you tried with lesser batch size?

RunningDongxu commented 4 years ago

It seems EfficientNet consumes more GPU memory than Resnet and Densenet. Has anyone solved the issue?