tensorflow/text

Issue in converting input text to tokens in nmt_with_attention.ipynb

devmadhuu opened this issue · 1 comments

Below code throwing error in nmt_with_attention.ipynb:

`# Convert the input text to tokens.
example_tokens = input_text_processor(example_input_batch)

Encode the input sequence.

encoder = Encoder(input_text_processor.vocabulary_size(),
embedding_dim, units)
example_enc_output, example_enc_state = encoder(example_tokens)

print(f'Input batch, shape (batch): {example_input_batch.shape}')
print(f'Input batch tokens, shape (batch, s): {example_tokens.shape}')
print(f'Encoder output, shape (batch, s, units): {example_enc_output.shape}')
print(f'Encoder state, shape (batch, units): {example_enc_state.shape}')`

Error
TypeError: Exception encountered when calling layer "encoder_1" (type Encoder).

'ShapeChecker' object is not callable

Call arguments received:
• tokens=tf.Tensor(shape=(64, 17), dtype=int64)
• state=None

Issue solved.