Best way would be lowering down the batch size. Usually it works. Otherwise try this: import gc
del variable #delete unnecessary variables gc.collect()
Best way would be lowering down the batch size. Usually it works. Otherwise try this: import gc
del variable #delete unnecessary variables gc.collect()