keras-explain icon indicating copy to clipboard operation
keras-explain copied to clipboard

LRP: problem in conv2d when padding = 'same'

Open andreapi87 opened this issue 5 years ago • 0 comments

when I use padding='same' in conv2d layers i get error. basic example: m = Sequential() m.add(Conv2D(512, kernel_size=(3, 3), activation='relu', padding='same', input_shape=(14,14,512),strides=(1,1))) m.add(MaxPooling2D(pool_size=(2,2))) m.summary()

explainer = LRP(m) exp = explainer.explain(numpy.ones((14,14,512)), 3)[0]

error: ValueError: operands could not be broadcast together with shapes (1,3,3,512,512) (1,3,2,512,1)

this is a problem especially in already trained model (e.g., vgg16)

andreapi87 avatar Jul 17 '20 10:07 andreapi87