Error on running code for training model

def train():

for i in range(epochs):
    generator = data_generator(train_descriptions,encoding_train,word_to_idx,max_len,batch_size)
    model.fit_generator(generator,epochs=1,steps_per_epoch=steps,verbose=1)
    model.save('./model_weights/model_'+str(i)+'.h5')
  • Error - AttributeError: module ‘keras.utils’ has no attribute ‘to_categorcial’

Hey @Navjot_3, make sure you have wrote this line on top,
from keras.utils import to_categorical

If error persists, share your ipynb by uploading it on google drive and sharing the link here.
Hope this resolved your doubt. :blush:

model.fit_generator(generator,epochs=1,initial_epoch=1,steps_per_epoch=steps,verbose=1)

Resolved it using the above call
Initial epoch was to be initialised

Hey @Navjot_3, Great job done, Happy Learning :sunny:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.