Deep-Learning-Projects
Deep-Learning-Projects copied to clipboard
Image caption generator
While training the model,
train the model
epochs = 20 batch_size = 32 steps = len(train) // batch_size
for i in range(epochs): # create data generator generator = data_generator(train, mapping, features, tokenizer, max_length, vocab_size, batch_size) # fit for one epoch model.fit(generator, epochs=1, steps_per_epoch=steps, verbose=1)
Getting error:
TypeError Traceback (most recent call last) Cell In[28], line 10 8 generator = data_generator(train, mapping, features, tokenizer, max_length, vocab_size, batch_size) 9 # fit for one epoch ---> 10 model.fit(generator, epochs=1, steps_per_epoch=1, verbose=1)
File /opt/conda/lib/python3.10/site-packages/keras/src/utils/traceback_utils.py:123, in filter_traceback.keras.config.disable_traceback_filtering()
--> 123 raise e.with_traceback(filtered_tb) from None
124 finally:
125 del filtered_tb
File /opt/conda/lib/python3.10/site-packages/tensorflow/python/data/ops/from_generator_op.py:124, in _from_generator(generator, output_types, output_shapes, args, output_signature, name)
122 for spec in nest.flatten(output_signature):
123 if not isinstance(spec, type_spec.TypeSpec):
--> 124 raise TypeError(f"output_signature must contain objects that are "
125 f"subclass of tf.TypeSpec but found {type(spec)} "
126 f"which is not.")
127 else:
128 if output_types is None:
TypeError: output_signature must contain objects that are subclass of tf.TypeSpec but found <class 'list'> which is not.
Still getting the same kind of error. Could you please update your notebook so that we can resolve the issue? Thanks in advance.
The issue is already fixed and the notebook & website is also updated. I have checked from my side, and few others also confirmed. Hence closing this thread.