Open ghost opened 4 years ago
The assumption is that all inputs have batch_size as the first dimension of the input tensor. This is what Keras does. As you have a pure TF model, it might be possible to fix DeepExplain to handle this case but it might be easier to define the size of your second input (which is always [1] as far as I understood)
Looking closer, the current DeepExplain requires each input to be at least two-dimensional. A workaround could be to define your second input as having shape [[1]]
On a similar note, I would like to use the occlusion techniques on a network where
model.input
shape is (?, 3, 224, 224)
,
model.output
shape is (?, 1000)
.
This of course works without any problems for the non-occlusion methods.
tf.reshape()
to (1, 3, 224, 224)
and (1, 1000)
respectively. However, this deletes the metadata of the keras model :-1: .ValueError: 'model_1/output_0/BiasAdd:0' is not a valid scope name
.Since I can not add a keras reshape layer once the model is trained, I am not really sure how to proceed. Maybe there is an easy fix for that?
Thanks!
Hi, I was trying to use DeepExplain on a tensorflow model which has two inputs:
So when I am trying to use explain method:
I get the following error:
"as_list() is not defined on an unknown TensorShape."
Is there a way to get around it?