Open diamondspark opened 4 years ago
Have you seen issue #11 ? I recently had this error in a custom network. I was working on Jupyter notebooks and clearing the Keras session prior to loading the model helped.
model_path = 'trained_models/name-of-the-model.h5'
K.clear_session()
model = load_model(model_path)
attrib_method = 'elrp'
#%% Loop begins
with DeepExplain(session = K.get_session()) as de:
# for performance improvements: https://github.com/marcoancona/DeepExplain#performance-explainer-api
input_tensor = model.layers[0].input
fModel = Model(inputs = input_tensor, outputs = model.layers[-2].output)
target_tensor = fModel(input_tensor)
explainer = de.get_explainer(attrib_method, target_tensor, input_tensor)
attributions = explainer.run(X, ys=pred)
I am trying to explain a CNN model. My model looks as following. Please advise what am I doing wrong. Thank you! `
This gives me the following error
My model looks as following