Keras assigns incrementing ID numbers to layers of the same type, e.g. max_pooling1d_7
, max_pooling1d_8
, max_pooling1d_9
,etc. Each ite
Each iteration shouldn't construct a new model. Training should go through in same model. Maybe post your code to see what might goes wrong.
The solution, from Attempting to reset tensorflow graph when using keras, failing:
from keras import backend as K
K.clear_session()
Add
tf.keras.backend.clear_session()
as in https://www.tensorflow.org/api_docs/python/tf/keras/backend/clear_session
Do you use jupyter notebooks? It seems like while you're rebuilding your model your tensorlow session won't restart. Because keras refers to tensorflow graphs per name it's necessary, that the counting continues.
So if you don't want to restartthe session you're fine. However this also means, that the tensorflow session gets bigger and bigger, so restarting the session might be the desired approach. For this restart the complete program/kernel.