week3//A2//Tigger //UNQ_C5

ValueError Traceback (most recent call last)
in
22
23
—> 24 modelf_test(modelf)

in modelf_test(target)
5 Tx = 5511
6 n_freq = 101
----> 7 model = target(input_shape = (Tx, n_freq))
8 expected_model = [[‘InputLayer’, [(None, 5511, 101)], 0],
9 [‘Conv1D’, (None, 1375, 196), 297136, ‘valid’, ‘linear’, (4,), (15,), ‘GlorotUniform’],

in modelf(input_shape)
47 # Step 4: Time-distributed dense layer (≈1 line)
48 # TimeDistributed with sigmoid activation
—> 49 X = TimeDistributed(Dense(1, activation = “sigmoid”))(X)
50
51 ### END CODE HERE ###

/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py in call(self, *args, **kwargs)
980 with ops.name_scope_v2(name_scope):
981 if not self.built:
→ 982 self._maybe_build(inputs)
983
984 with ops.enable_auto_cast_variables(self._compute_dtype_object):

/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py in _maybe_build(self, inputs)
2641 # operations.
2642 with tf_utils.maybe_init_scope(self):
→ 2643 self.build(input_shapes) # pylint:disable=not-callable
2644 # We must set also ensure that the layer is marked as built, and the build
2645 # shape is stored since user defined build functions may not be calling

/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/layers/wrappers.py in build(self, input_shape)
167
168 def build(self, input_shape):
→ 169 input_shape = tensor_shape.TensorShape(input_shape).as_list()
170 if len(input_shape) < 3:
171 raise ValueError(

/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/tensor_shape.py in as_list(self)
1188 “”"
1189 if self._dims is None:
→ 1190 raise ValueError(“as_list() is not defined on an unknown TensorShape.”)
1191 return [dim.value for dim in self._dims]
1192

ValueError: as_list() is not defined on an unknown TensorShape.

Here seems like a problem :X = TimeDistributed(Dense(1, activation = "sigmoid"))(X)

That line of code looks fine. The error is probably somewhere else in the modelf() function.