Skip to content

Commit 262754b

Browse files
committed
Reset tf graph for train_and_eval to solve the memory leak.
Estimator rebuilds the graph for every epoch in train_and_eval mode. This is probably the main reason of increasing memory usage.
1 parent e66539e commit 262754b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

efficientdet/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ def run_train_and_eval(e):
355355
if p.exitcode != 0:
356356
return p.exitcode
357357
else:
358+
tf.compat.v1.reset_default_graph()
358359
run_train_and_eval(e)
359360

360361
else:

0 commit comments

Comments
 (0)