Closed saberAL closed 3 years ago
Hi,
at least for LRP Methods, ResNet is not supported in innvestigate 1.0. Version 2.0 is still under development. I recommend trying out alternative XAI solutions.
Bets
Hi, could you please tell me which ones are supported? Thank you
Hi, normal Conv Networks like VGG16. Best
Thank you for answering me, but I tried VGG16 and loaded my finetuned model:
vgg = VGG16(input_shape = (image_height, image_width, 3), weights = 'imagenet',include_top = False)
for layer in vgg.layers:
layer.trainable=True
x = Flatten()(vgg.output)
x = Dense(2048, activation='relu')(x)
x = Dropout(0.5)(x)
prediction = Dense(1, activation='sigmoid')(x)
model = Model(input = vgg.input, output = prediction)
where image_heigth=image_width=224, but I get valueError when checking input:
Here the traceback:
Hi,
did you feed in a batch [Batch_size, 224, 224, 3] ? You need to add the batch dimension.
You should first try to define a simple LeNet from Scratch. If it works, but VGG16 not, then you can try out to "unpack" the VGG model i.e. something like this
for layer in model.layers: x = layer(x)
Because if you do model.layers on a model that is comprised of submodels, you do not get the actual layers, but the keras.model instances. Innvestigate might be confused.
Unfortunately, I can not help you furthermore on this as I am not familiar with the inner workings of innvestigate 1.0.
Best
Yes but it gives me error because input_shape must be a triple tuple. Thank you so much for the help, I will try it.
No worries, And do not forget: innvestigate.analyze( images, ...) the images have to be [batch, width, height, channel] dimension
I solved the problem, I was selecting the first image of the batch. Thank you so much.
nice!
Hello, I was trying to use innvestigate in combination with a finetuned Resnet50 model which I created in keras, by taking off the last layer and adding a dense layer with sigmoid activation function. I loaded the model and created the analyzer according to tutorial, the problem is when I try to analyze a given image, I run into an Exception that only states that it is not supposed to happen. Maybe I am using the analyzer in a wrong way or maybe it doesn't work with my model. This my model:
and this is the analayzer:
that gives the following tracetrack:![Screenshot from 2020-12-10 15-40-01](https://user-images.githubusercontent.com/45983012/101787037-ed2a2b00-3afe-11eb-9bdf-e4259e7c3c08.png)
Thank you.