UNQ_C1
the can not change block is missing “training=False is missing” for
A3 = identity_block(X, f=2, filters=[4, 4, 3],
initializer=lambda seed=0:constant(value=1))
print(‘\033[1mWith training=False\033[0m\n’)
and I can not change it
the can not change block is missing “training=False is missing” for
A3 = identity_block(X, f=2, filters=[4, 4, 3],
initializer=lambda seed=0:constant(value=1))
print(‘\033[1mWith training=False\033[0m\n’)
and I can not change it
Are you sure that you are using a current version of the notebook and not one that you copied from github? This assignment was changed a while ago not to use the training
variable in the user code.
You also don’t show us the complete exception trace on the left side of your screenshot, so we can’t really see what is happening there.
The other general point to make here is that if the test fails, the solution is not to change the test. It is to figure out what the test is telling you about why your code is incorrect.
NameError Traceback (most recent call last)
Input In [27], in <cell line: 13>()
9 X3 = np.ones((1, 4, 4, 3)) * 3
11 X = np.concatenate((X1, X2, X3), axis = 0).astype(np.float32)
—> 13 A3 = identity_block(X, f=2, filters=[4, 4, 3],
14 initializer=lambda seed=0:constant(value=1))
15 print(‘\033[1mWith training=False\033[0m\n’)
16 A3np = A3.numpy()
Input In [26], in identity_block(X, f, filters, initializer)
24 # First component of main path
25 X = Conv2D(filters = F1, kernel_size = 1, strides = (1,1), padding = ‘valid’, kernel_initializer = initializer(seed=0))(X)
—> 26 X = BatchNormalization(axis = 3)(X, training = training) # Default axis
27 X = Activation(‘relu’)(X)
29 ### START CODE HERE
30 ## Second component of main path (≈3 lines)
31 ## Set the padding = ‘same’
NameError: name ‘training’ is not defined
Expected value
I tried to reload the notebook to get the latest version but it comes with what I wrote code. Do you know how to reset the notebook with code back to the beginning?
That means you didn’t move your version out of the way first. The complete instructions including explanation of why your method didn’t work is on this thread.
I just found how to return back to original code, by click file–> revert to check point @ earlier date.
After I revert back to checkpoint, the code works
Thank you!