sicara / tf-explain

Interpretability Methods for tf.keras models with Tensorflow 2.x
https://tf-explain.readthedocs.io
MIT License
1.02k stars 111 forks source link

ActivationsVisualizationCallback: predictions and filter_display dimension issue. #68

Closed Hassanfarooq92 closed 5 years ago

Hassanfarooq92 commented 5 years ago

Dimension of prediction's output is (number of images, number of classes) while filter_display is looking for a 4D array.

RaphaelMeudec commented 5 years ago

The callback is meant for convolutional layers visualisation and you're probably trying to apply it on a dense layer. That's why you're having a shape issue

Hassanfarooq92 commented 5 years ago

So i should apply it after the activation function of convolution layers. And ur gradcam gives gpu memory error. I have rtx 2080ti

On Mon, Aug 5, 2019, 2:11 PM Raphael Meudec notifications@github.com wrote:

The callback is meant for convolutional layers visualisation and you're probably trying to apply it on a dense layer. That's why you're having a shape issue

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sicara/tf-explain/issues/68?email_source=notifications&email_token=AJO3I2I63IR7M2ZBDL63IIDQC7VDNA5CNFSM4IJIXFX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3RGFKY#issuecomment-518152875, or mute the thread https://github.com/notifications/unsubscribe-auth/AJO3I2PL7YOVBTLN7QDPF2DQC7VDNANCNFSM4IJIXFXQ .

Hassanfarooq92 commented 5 years ago

Got the stuff working. Just to let you know if model is being load and modified separately, it might give error of 'graph disconnected', shouldn't be difficult to tackle if it appears up.

rao208 commented 4 years ago

@Hassanfarooq92 So, should we apply it after the activation function of convolution layers or after the cnn layer(if activation is not defined inside the layer)?