Only new lists should be saved
Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
@ -182,6 +182,7 @@ def _predict_one_epoch(dataset: tf.data.Dataset,
|
|||||||
counter = 0
|
counter = 0
|
||||||
import gc
|
import gc
|
||||||
from tensorflow.python.eager import context
|
from tensorflow.python.eager import context
|
||||||
|
lists = None
|
||||||
|
|
||||||
for inputs in dataset:
|
for inputs in dataset:
|
||||||
decoded_predictions_batch = []
|
decoded_predictions_batch = []
|
||||||
@ -216,9 +217,14 @@ def _predict_one_epoch(dataset: tf.data.Dataset,
|
|||||||
from pympler import muppy, summary
|
from pympler import muppy, summary
|
||||||
all_objects = muppy.get_objects()
|
all_objects = muppy.get_objects()
|
||||||
all_lists = muppy.filter(all_objects, Type=list)
|
all_lists = muppy.filter(all_objects, Type=list)
|
||||||
for i, l in enumerate(all_lists):
|
if lists is None:
|
||||||
with open(f"list-{i}.txt", "w") as file:
|
lists = map(id, all_lists)
|
||||||
file.write(str(l))
|
list_nr = 0
|
||||||
|
for l in all_lists:
|
||||||
|
if id(l) not in lists:
|
||||||
|
with open(f"list-{counter}-{list_nr}.txt", "w") as file:
|
||||||
|
file.write(l)
|
||||||
|
list_nr += 1
|
||||||
|
|
||||||
epoch_end_time = time.time()
|
epoch_end_time = time.time()
|
||||||
per_epoch_time = epoch_end_time - epoch_start_time
|
per_epoch_time = epoch_end_time - epoch_start_time
|
||||||
|
|||||||
Reference in New Issue
Block a user