Closed ramidim closed 3 years ago
which notebook are you reporting an issue with? I do not understand the context of your question.
I am using google collab ...when I try to execute above code it has thrown error
Are you trying to run one of my notebooks?
Yes, I am trying to run Image caption generator
I cannot reproduce the issue on my notebook. This is probably a better question for StackOverflow or similar.
number_pics_per_bath = 3 steps = len(train_descriptions)//number_pics_per_bath model_path = os.path.join(root_captioning,"data",f'caption-model.hdf5') if not os.path.exists(model_path): for i in tqdm(range(EPOCHS*2)): generator = data_generator(train_descriptions, encoding_train, wordtoidx, max_length, number_pics_per_bath) caption_model.fit(generator, epochs=1, steps_per_epoch=steps, verbose=1) caption_model.optimizer.lr = 1e-4 number_pics_per_bath = 6 steps = len(train_descriptions)//number_pics_per_bath for i in range(EPOCHS): generator = data_generator(train_descriptions, encoding_train, wordtoidx, max_length, number_pics_per_bath) caption_model.fit(generator, epochs=1, steps_per_epoch=steps, verbose=1)
caption_model.save_weights(model_path) print(f"\Training took: {hms_string(time()-start)}") else: caption_model.load_weights(model_path)
############################################################################################### 0%| | 0/20 [00:00<?, ?it/s]
KeyError Traceback (most recent call last)