Hi there,
Struggled for hours to try and get this right to no avail. Been through all of the documentation. Tried numerous different changes. Sorry to put the code out there but really stuck. Seems to object to P1 line, but have no confidence in any of it. So many subtle differences in path, API calls and syntax within the same module. Also changed the last line model=…
Any help would be much appreciated.
CONV2D: 8 filters 4x4, stride of 1, padding ‘SAME’
# Z1 = tf.Conv2D(8, (4, 4), strides = (1, 1), padding = 'SAME'),
Z1 = tfl.Conv2D(8, (4,4), strides = (1,1), padding='SAME')(input_img),
## RELU
A1 = tfl.ReLU()(Z1),
## MAXPOOL: window 8x8, stride 8, padding 'SAME'
#tf.keras.layers.MaxPool2D(pool_size=(f, f), strides=(s, s), padding='same'):
#tf.keras.layers.MaxPool2D(pool_size=(f, f), strides=(s, s), padding='same'):
P1 = tf.keras.layers.MaxPool2D(pool_size=(8, 8), strides = (8, 8), padding = 'SAME')(A1),
## CONV2D: 16 filters 2x2, stride 1, padding 'SAME'
Z2 = tfl.Conv2D(16, (2, 2), strides = (1, 1), padding = 'SAME')(P1),
## RELU
A2 = tfl.ReLU()(Z2),
## MAXPOOL: window 4x4, stride 4, padding 'SAME'
#tf.keras.layers.MaxPool2D(pool_size=(f, f), strides=(s, s), padding='same'):
P2 = tfl.MaxPool2D(pool_size=(4,4), strides = (4, 4), padding = 'SAME')(A2),
## FLATTEN
F = tfl.Flatten()(P2),
## Dense layer
## 6 neurons in output layer. Hint: one of the arguments should be "activation='softmax'"
#outputs = tfl.Dense(6, activation='softmax',),
outputs = tfl.Dense(units=6, activation='softmax')(F),
# YOUR CODE ENDS HERE
model = tf.keras.layers.Model(inputs=input_img, outputs=outputs)
return model