convolutional layer nach maxpooling layer
Verfasst: Donnerstag 16. Juni 2022, 18:58
Wenn ich nach einem convolutional und maxpooling layer einen convolutional layer verwende, dann erscheint folgende fehlermeldung:
ValueError: Input 0 of layer "conv2d_48" is incompatible with the layer: expected axis -1 of input shape to have value 64, but received input with shape (None, 14, 14, 128)
Beispiel code:
Kann mir bitte jemand helfen bitte:-)
ValueError: Input 0 of layer "conv2d_48" is incompatible with the layer: expected axis -1 of input shape to have value 64, but received input with shape (None, 14, 14, 128)
Beispiel code:
Code: Alles auswählen
instanz = keras.layers.Conv2D(filters = 64, kernel_size =7 ,activation='relu', padding="SAME",
input_shape = [28,28,1])
output1 = instanz(input)
output1.shape # shape ist: ([3, 28, 28, 64])
maxpool_instanz = MaxPooling2D(pool_size = 2)
output2 = maxpool_instanz(output1)
output2.shape # shape ist: ([3, 14, 14, 64])
# bei dieser Zeile entsteht der code
output3 = instanz(output2)