title: ValueError: Calling `Model.fit` in graph mode is not supported when the `Model` instance was constructed with eager mode enabled
body: <pre><code>for i in range(epochs):
    gen = data_generator(train_descriptions,encoding_train,word_to_idx,max_len,batch_size)
    model.fit(gen,epochs=1,steps_per_epoch=steps,verbose=1)
    model.save(&quot;best_model.h5&quot;)
  </code></pre>
  <blockquote>
  <p>ValueError: Calling Model.fit in graph mode is not supported when
  the Model instance was constructed with eager mode enabled. Please
  construct your Model instance in graph mode or call Model.fit with
  eager mode enabled.</p>
  </blockquote>
  <p>How do I solve this error?</p>