Open muellerdo opened 3 years ago
Delete last model before overwriting when loading a new model
Problem: Tensorflow caches various model variables which can lead to OOM when switching multiple times between different models.
Solution: clear session when loading a new model. tf.keras.backend.clear_session()
tf.keras.backend.clear_session()
Note for me: clear_session probably not working when using multiple model variables!!!
Note for Ensemble Learning: Delete models at the end to avoid this issue
K.clear_session() tf.compat.v1.reset_default_graph()
Delete last model before overwriting when loading a new model
Problem: Tensorflow caches various model variables which can lead to OOM when switching multiple times between different models.
Solution: clear session when loading a new model.
tf.keras.backend.clear_session()
Note for me: clear_session probably not working when using multiple model variables!!!
Note for Ensemble Learning: Delete models at the end to avoid this issue