title: I got 'ValueError: No gradients provided for any variable:'
body: <p>When I train the ML model that other team members had no problem with,</p>
  <p>but I got 'ValueError: No gradients provided for any variable:'</p>
  <p>Total error statement is below</p>
  <p><code>ValueError: No gradients provided for any variable: ['dense/kernel:0', 'dense/bias:0', 'lstm/lstm_cell/kernel:0', 'lstm/lstm_cell/recurrent_kernel:0', 'lstm/lstm_cell/bias:0', 'dense_1/kernel:0', 'dense_1/bias:0', 'dense_2/kernel:0', 'dense_2/bias:0'].</code></p>
  <p>and below is the block of Jupyter Notebook that makes error</p>
  <pre><code>model.layers[2]
  model.layers[2].set_weights([embedding_matrix])
  model.layers[2].trainable = False
  
  model.compile(loss='categorical_crossentropy', optimizer='adam')
  
  epochs = 10
  number_pics_per_bath = 3
  steps = len(train_descriptions)//number_pics_per_bath
  
  for i in range(epochs):
      generator = data_generator(train_descriptions, train_features, wordtoix, max_length, number_pics_per_bath)
      model.fit_generator(generator, epochs=1, steps_per_epoch=steps, verbose=1)
      model.save('C:/MyAI/archive/model_' + str(i) + '.h5')
  </code></pre>
  <p>i think you also want to see my total code. it is easy, because I almost copied the code of below github link</p>
  <p><a href="https://github.com/hlamba28/Automatic-Image-Captioning/blob/master/Automatic%20Image%20Captioning.ipynb" rel="nofollow noreferrer">https://github.com/hlamba28/Automatic-Image-Captioning/blob/master/Automatic%20Image%20Captioning.ipynb</a></p>
  <p>because I don't have the same path or name of file like github,
  I changed a little bit of above github code, but i did not change the logical part of code.</p>
  <p>and my other team member said he had no problem with our code (that is changed a little bit), and showed me that ML model is trained well and make result intended.</p>