'Initializing the model on tensorflow consumes 18 gigabytes of video memory

I am trying to finetune mobilenetV2 with tensorflow. But when I initialize it with:

base_model = tf.keras.applications.MobileNetV2(input_shape=IMG_SHAPE,
                                               include_top=False, 
                                               weights="imagenet")

it consumed 18gb VRAM, so i cant train it. How can I fix it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source