I'm working off the LSTM language model tutorial discussed here.
With language models, it's common to use the model to generate a new sentence from scratch after training (i.e. sample from the model).
I'm new to TensorFlow but I'm trying to use my trained model to generate new words until the end-of-sentence marker.
My initial attempt:
x = tf.zeros_like(m.input_data)
state = m.initial_state.eval()
for step in xrange(m.num_steps):
state = session.run(m.final_state,
{m.input_data: x,
m.initial_state: state})
x = state
It fails with error:
ValueError: setting an array element with a sequence.