Deep-Learning-Projects icon indicating copy to clipboard operation
Deep-Learning-Projects copied to clipboard

Image caption generator

Open shubham-jaware opened this issue 1 year ago • 1 comments

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..error_handler(*args, **kwargs) 120 filtered_tb = _process_traceback_frames(e.traceback) 121 # To get the full stack trace, call: 122 # 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.

shubham-jaware avatar Mar 28 '24 17:03 shubham-jaware

Still getting the same kind of error. Could you please update your notebook so that we can resolve the issue? Thanks in advance.

gulshanarya avatar May 22 '24 20:05 gulshanarya

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.

aswintechguy avatar May 23 '24 04:05 aswintechguy