@ -181,7 +181,6 @@ def _predict_one_epoch(dataset: tf.data.Dataset,
|
|||||||
# go through the data set
|
# go through the data set
|
||||||
counter = 0
|
counter = 0
|
||||||
import gc
|
import gc
|
||||||
import sys
|
|
||||||
from tensorflow.python.eager import context
|
from tensorflow.python.eager import context
|
||||||
|
|
||||||
for inputs in dataset:
|
for inputs in dataset:
|
||||||
@ -210,24 +209,10 @@ def _predict_one_epoch(dataset: tf.data.Dataset,
|
|||||||
|
|
||||||
counter += 1
|
counter += 1
|
||||||
|
|
||||||
print((
|
|
||||||
f"counter: {counter}"
|
|
||||||
f"list: {sys.getrefcount(decoded_predictions_batch)}"
|
|
||||||
f"result: {sys.getrefcount(result)}"
|
|
||||||
f"np list: {sys.getrefcount(decoded_predictions_batch_np)}"
|
|
||||||
))
|
|
||||||
|
|
||||||
tf.set_random_seed(1)
|
tf.set_random_seed(1)
|
||||||
context.context()._clear_caches()
|
context.context()._clear_caches()
|
||||||
gc.collect()
|
gc.collect()
|
||||||
|
|
||||||
print((
|
|
||||||
f"counter: {counter}"
|
|
||||||
f"list: {sys.getrefcount(decoded_predictions_batch)}"
|
|
||||||
f"result: {sys.getrefcount(result)}"
|
|
||||||
f"np list: {sys.getrefcount(decoded_predictions_batch_np)}"
|
|
||||||
))
|
|
||||||
|
|
||||||
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