Skip to content
Snippets Groups Projects
Commit 90d8f7a9 authored by Dennis Noll's avatar Dennis Noll
Browse files

[keras] added GC callback

parent a01971fd
No related branches found
No related tags found
No related merge requests found
# from itertools import izip
import gc
from collections import OrderedDict, defaultdict
import fnmatch
import numpy as np
import tensorflow as tf
from tqdm import tqdm
......@@ -597,6 +599,11 @@ class ModelLH(tf.keras.Model):
return ret
class GCCallback(tf.keras.callbacks.Callback):
def on_epoch_end(self, epoch, logs=None):
gc.collect()
class TensorBoard(tf.keras.callbacks.TensorBoard):
def __init__(self, *args, **kwargs):
self.writer = kwargs.pop("writer")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment