I don’t understand where the following error is coming from.
TypeError Traceback (most recent call last)
in
----> 1 model2 = alpaca_model(IMG_SIZE, data_augmentation)
in alpaca_model(image_shape, data_augmentation)
42
43 # create a prediction layer with one neuron (as a classifier only needs one)
—> 44 prediction_layer = base_model.predict(x)
45
46 ### END CODE HERE
/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/training.py in _method_wrapper(self, *args, **kwargs)
128 raise ValueError(’{} is not supported in multi-worker mode.’.format(
129 method.name))
→ 130 return method(self, *args, **kwargs)
131
132 return tf_decorator.make_decorator(
/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/training.py in predict(self, x, batch_size, verbose, steps, callbacks, max_queue_size, workers, use_multiprocessing)
1577 use_multiprocessing=use_multiprocessing,
1578 model=self,
→ 1579 steps_per_execution=self._steps_per_execution)
1580
1581 # Container that configures and calls tf.keras.Callback
s.
/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/data_adapter.py in init(self, x, y, sample_weight, batch_size, steps_per_epoch, initial_epoch, epochs, shuffle, class_weight, max_queue_size, workers, use_multiprocessing, model, steps_per_execution)
1115 use_multiprocessing=use_multiprocessing,
1116 distribution_strategy=ds_context.get_strategy(),
→ 1117 model=model)
1118
1119 strategy = ds_context.get_strategy()
/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/data_adapter.py in init(self, x, y, sample_weights, sample_weight_modes, batch_size, epochs, steps, shuffle, **kwargs)
273 inputs = pack_x_y_sample_weight(x, y, sample_weights)
274
→ 275 num_samples = set(int(i.shape[0]) for i in nest.flatten(inputs))
276 if len(num_samples) > 1:
277 msg = “Data cardinality is ambiguous:\n”
/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/data_adapter.py in (.0)
273 inputs = pack_x_y_sample_weight(x, y, sample_weights)
274
→ 275 num_samples = set(int(i.shape[0]) for i in nest.flatten(inputs))
276 if len(num_samples) > 1:
277 msg = “Data cardinality is ambiguous:\n”
TypeError: int() argument must be a string, a bytes-like object or a number, not ‘NoneType’