Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix missing positional argument to padded_batch #1506

Closed
wants to merge 1 commit into from

Conversation

jsenellart
Copy link

When running tutorial load_data/text.ipynb with tensorflow 2.1 - the following line fails:

train_data = train_data.padded_batch(BATCH_SIZE)

with the error message:

TypeError: padded_batch() missing 1 required positional argument: 'padded_shapes'

And the document actually mentions this argument: https://www.tensorflow.org/api_docs/python/tf/data/Dataset#padded_batch.

The proposed patch adds the expected parameters with default value to pad on the text sequence.

@tfdocsbot
Copy link
Collaborator

Preview and run these notebook edits with Google Colab:

Notebook diffs available on ReviewNB.com.

@googlebot googlebot added the cla: yes CLA has been signed label Mar 19, 2020
@MarkDaoust
Copy link
Member

Yeah, this is causing a lot of confusion.

I added the pip install tf-nightly at the top but that's not enough.

Thanks for the PR. I'm sending a fix for all the tutorials.

@MarkDaoust MarkDaoust closed this Mar 19, 2020
TensorFlow-Docs-Copybara pushed a commit that referenced this pull request Mar 19, 2020
The `tf-nightly` usage is causing a lot of confusion.
Adding a note explaining the difference and that the simplified form is only available in tf2.2.

Fixes tensorflow/tensorflow#37713
See also: #1301, #1414, #1415, #1465, #1485, #1486, #1505, #1506, #1507

PiperOrigin-RevId: 301834298
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes CLA has been signed
Projects
None yet
4 participants