i have declared base.training=False but its initial declaration was x= base_model(None,training=None)
is that a error as its giving final error as
Pls help me. if you spot some error in it.
AttributeError Traceback (most recent call last)
in
----> 1 model2 = alpaca_model(IMG_SIZE, data_augmentation)
in alpaca_model(image_shape, data_augmentation)
37 # Add the new Binary classification layers
38 # use global avg pooling to summarize the info in each channel
—> 39 x = tfl.GlobalAveragePooling2D()(x)
40 #include dropout with probability of 0.2 to avoid overfitting
41 x =tf.keras.layers.Dropout(rate = 0.2)(x)
/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)
2616 if not self.built:
2617 input_spec.assert_input_compatibility(
→ 2618 self.input_spec, inputs, self.name)
2619 input_list = nest.flatten(inputs)
2620 if input_list and self._dtype_policy.compute_dtype is None:
/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/input_spec.py in assert_input_compatibility(input_spec, inputs, layer_name)
164 spec.min_ndim is not None or
165 spec.max_ndim is not None):
→ 166 if x.shape.ndims is None:
167 raise ValueError('Input ’ + str(input_index) + ’ of layer ’ +
168 layer_name + ’ is incompatible with the layer: ’
AttributeError: ‘function’ object has no attribute ‘shape’