tensorflow / tensorflow/text

nmt_with_attention no longer works on Colab

Open
#1,267 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
1.3k
Forks
379
Avg merge
3h 30m
Merged PRs (30d)
8

Description

Hello,

I got stuck halfway through in the nmt_with_attention Colab:

---------------------------------------------------------------------------

ValueError                                Traceback (most recent call last)

[<ipython-input-34-f0271e0d820d>](https://localhost:8080/#) in <cell line: 1>()
----> 1 logits = decoder(ex_context, ex_tar_in)
      2 
      3 print(f'encoder output shape: (batch, s, units) {ex_context.shape}')
      4 print(f'input target tokens shape: (batch, t) {ex_tar_in.shape}')
      5 print(f'logits shape shape: (batch, target_vocabulary_size) {logits.shape}')

1 frames

[<ipython-input-30-dcee1b38b45f>](https://localhost:8080/#) in call(self, context, x, state, return_state)
     13 
     14   # 2. Process the target sequence.
---> 15   x, state = self.rnn(x, initial_state=state)
     16   shape_checker(x, 'batch t units')
     17 

ValueError: Exception encountered when calling Decoder.call().

too many values to unpack (expected 2)

Arguments received by Decoder.call():
  • context=tf.Tensor(shape=(64, 18, 256), dtype=float32)
  • x=tf.Tensor(shape=(64, 16), dtype=int64)
  • state=None
  • return_state=False

When I first tried this notebook a long time ago, it worked though.

Regards.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the nmt_with_attention Colab and reproduce the failure at logits = decoder(ex_context, ex_tar_in). Inspect Decoder.call() around x, state = self.rnn(x, initial_state=state) and the surrounding notebook cells. Done means the notebook executes that cell and prints the encoder, target-token, and logits shapes without the ValueError.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, tensorflow
Domain
documentation, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.