URGENT: issue encountered in Text generation with an RNN tutorial

def call(self, inputs, states=None, return_state=False, training=False):
x = inputs
x = self.embedding(x, training=training)
if states is None:
states = self.gru.get_initial_state(x)
x, states = self.gru(x, initial_state=states, training=training)
x = self.dense(x, training=training)

if return_state:
  return x, states
else:
  return x

this code in tutorial throws invalid argument error. Gemini told that get_initial_states do not expect 3d input. How to fix this?

Hi @abdullah_ahmad, Thanks for reporting this issue. As a work around I recommend you to use tf_keras without callbacks. This works fine without causing the error. please refer to this gist. Thank You.

Hi @abdullah_ahmad, Apologize for this the tutorial works fine with tf_keras including callbacks and also a PR has been created for this issue to be resolved. Thank You.