cytometer/utils.py
def clear_mem():
    """GPU garbage collection in Keras with TensorFlow.

    From Otto Stegmaier and Jeremy Howard.
    https://forums.fast.ai/t/gpu-garbage-collection/1976/5
    """

    K.get_session().close()
    sess = K.get_session()
    sess.close()
    # limit mem
    cfg = tf.ConfigProto()
    cfg.gpu_options.allow_growth = True
    K.set_session(tf.Session(config=cfg))
    return
GPU garbage collection in Keras with TensorFlow.

    From Otto Stegmaier and Jeremy Howard.
    https://forums.fast.ai/t/gpu-garbage-collection/1976/5
    
GPU garbage collection in Keras with TensorFlow.
From Otto Stegmaier and Jeremy Howard.
GPU garbage collection in Keras with TensorFlow . From Otto Stegmaier and Jeremy Howard .
def clear_mem():
    K.get_session().close()
    sess = K.get_session()
    sess.close()
    cfg = tf.ConfigProto()
    cfg.gpu_options.allow_growth = True
    K.set_session(tf.Session(config=cfg))
    return
def clear_mem ( ) : K . get_session ( ) . close ( ) sess = K . get_session ( ) sess . close ( ) cfg = tf . ConfigProto ( ) cfg . gpu_options . allow_growth = True K . set_session ( tf . Session ( config = cfg ) ) return
GPU garbage collection in Keras with TensorFlow.
GPU garbage collection in Keras with TensorFlow .
"""GPU garbage collection in Keras with TensorFlow.

    From Otto Stegmaier and Jeremy Howard.
    https://forums.fast.ai/t/gpu-garbage-collection/1976/5
    """ # limit mem