Course 4 week 2 CNN

there are some issues? I can’t find, but it doesn’t work

X = Conv2D(filters=F2,kernel_size=f,strides=(1,1),padding=‘valid’,kernel_initializer=initializer(seed=0))(X)
X = BatchNormalization(axis=3)(X,training=training)
X = Activation(‘relu’)(X)

## Third component of main path (≈2 lines)
X = Conv2D(filters=F3,kernel_size=1,strides=(1,1),padding='valid',kernel_initializer=initializer(seed=0))(X)
X = BatchNormalization(axis=3)(X,training=training)

## Final step: Add shortcut value to main path, and pass it through a RELU activation (≈2 lines)
X = Add()([X,X_shortcut])
X = Activation('relu')(X)

I think your call to BatchNormalization() is incorrect. The “training=training” may be in the wrong place.

1 Like

thank you , I solve it :grinning: