ValueError Traceback (most recent call last)
Input In [5], in <cell line: 3>()
1 ### you cannot edit this cell
----> 3 public_tests.convolutional_block_test(convolutional_block)
File /tf/W2A1/public_tests.py:102, in convolutional_block_test(target)
98 X3 = np.ones((1, 4, 4, 3)) * 3
100 X = np.concatenate((X1, X2, X3), axis = 0).astype(np.float32)
→ 102 A = target(X, f = 2, filters = [2, 4, 6], training=False)
104 assert type(A) == EagerTensor, “Use only tensorflow and keras functions”
105 assert tuple(tf.shape(A).numpy()) == (3, 2, 2, 6), “Wrong shape.”
Input In [4], in convolutional_block(X, f, filters, s, training, initializer)
49 X = BatchNormalization(axis = 3)(X, training=training)
51 ### END CODE HERE
52
53 # Final step: Add shortcut value to main path (Use this order [X, X_shortcut]), and pass it through a RELU activation
—> 54 X = Add()([X, X_shortcut])
55 X = Activation(‘relu’)(X)
57 return X
File /usr/local/lib/python3.8/dist-packages/keras/utils/traceback_utils.py:67, in filter_traceback..error_handler(*args, **kwargs)
65 except Exception as e: # pylint: disable=broad-except
66 filtered_tb = _process_traceback_frames(e.traceback)
—> 67 raise e.with_traceback(filtered_tb) from None
68 finally:
69 del filtered_tb
File /usr/local/lib/python3.8/dist-packages/keras/layers/merging/base_merge.py:73, in _Merge._compute_elemwise_op_output_shape(self, shape1, shape2)
71 else:
72 if i != j:
—> 73 raise ValueError(
74 ‘Inputs have incompatible shapes. ’
75 f’Received shapes {shape1} and {shape2}’)
76 output_shape.append(i)
77 return tuple(output_shape)
ValueError: Inputs have incompatible shapes. Received shapes (1, 1, 6) and (4, 4, 3)
here’s the whole message