Skip to content

Commit a10a97c

Browse files
committed
del model and clear_session calls switched
1 parent 77b8ec0 commit a10a97c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

fed_learn/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
from keras import backend as K
2+
import gc
23

34

45
def get_rid_of_the_models(model=None):
6+
# TODO: somehow this does not free up the GPU memory (after a while you will get OOM) (tested on Windows 10...)
7+
K.clear_session()
58
if model is not None:
69
del model
7-
K.clear_session()
10+
gc.collect()

0 commit comments

Comments
 (0)