# Padding Sequences Error

**URL:** <https://community.deeplearning.ai/t/padding-sequences-error/175524>\
**Category:** Natural Language Processing in TensorFlow\
**Tags:** week-module-1\
**Created:** [August 1, 2022, 5:10pm UTC](https://community.deeplearning.ai/t/padding-sequences-error/175524 "2022-08-01T17:10:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![elmira\_kalhor](https://avatars.discourse-cdn.com/v4/letter/e/7993a0/32.png) [@elmira\_kalhor](https://community.deeplearning.ai/u/elmira_kalhor)\
**Post date:** [August 1, 2022, 5:10pm UTC](https://community.deeplearning.ai/t/padding-sequences-error/175524/1 "2022-08-01T17:10:02Z")

</div>

Hi,

I wasn’t sure what to put for maxlen and I just used the value in the expected outcome. I got the following error from the grader:  
“operands could not be broadcast together with shapes (XXXX,) (Y,)”; I removed the numbers in parentheses, but the XXXX is the number I got from the expected outcome, and Y is an integer \<10.  
No errors show up on my end.

What could be the issue?

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [August 1, 2022, 5:38pm UTC](https://community.deeplearning.ai/t/padding-sequences-error/175524/2 "2022-08-01T17:38:44Z")

</div>

Please click my name and message your notebook as an attachment.

---

<div class="post-metadata">

**Author:** ![Ann\_Maria](https://avatars.discourse-cdn.com/v4/letter/a/c77e96/32.png) [@Ann\_Maria](https://community.deeplearning.ai/u/Ann_Maria)\
**Post date:** [August 3, 2022, 2:25pm UTC](https://community.deeplearning.ai/t/padding-sequences-error/175524/3 "2022-08-03T14:25:25Z")

</div>

I did the same thing and had the same error. How did you solve it?

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [August 3, 2022, 3:43pm UTC](https://community.deeplearning.ai/t/padding-sequences-error/175524/4 "2022-08-03T15:43:25Z")

</div>

Please click my name and message your notebook as an attachment.

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [August 11, 2022, 6:26am UTC](https://community.deeplearning.ai/t/padding-sequences-error/175524/5 "2022-08-11T06:26:26Z")

</div>

The default values for `padding` and `truncating` should be used and you should not specify a custom value inside the function `def get_padded_sequences(tokenizer, sentences):`
