# C5\_W2\_A2 Emojify

**URL:** <https://community.deeplearning.ai/t/c5-w2-a2-emojify/116841>\
**Category:** Sequence Models\
**Tags:** coursera-platform\
**Created:** [April 6, 2022, 9:20pm UTC](https://community.deeplearning.ai/t/c5-w2-a2-emojify/116841 "2022-04-06T21:20:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dininno](https://avatars.discourse-cdn.com/v4/letter/d/96bed5/32.png) [@Dininno](https://community.deeplearning.ai/u/Dininno)\
**Post date:** [April 6, 2022, 9:20pm UTC](https://community.deeplearning.ai/t/c5-w2-a2-emojify/116841/1 "2022-04-06T21:20:28Z")

</div>

Hi, I’m having some trouble with the last exercise of the Emojify assignment, I have passed all the previous exercises but in the last one I get this error:

Test failed  
Expected value

[‘LSTM’, (None, 4, 128), 67072, (None, 4, 2), ‘tanh’, True]

does not match the input value:

## [‘LSTM’, (None, 128), 67072, (None, 4, 2), ‘tanh’, False]

AssertionError Traceback (most recent call last)  
 in   
22  
23  
—\> 24 Emojify\_V2\_test(Emojify\_V2)

in Emojify\_V2\_test(target)  
19  
20 expectedModel = [[‘InputLayer’, [(None, 4)], 0], [‘Embedding’, (None, 4, 2), 30], [‘LSTM’, (None, 4, 128), 67072, (None, 4, 2), ‘tanh’, True], [‘Dropout’, (None, 4, 128), 0, 0.5], [‘LSTM’, (None, 128), 131584, (None, 4, 128), ‘tanh’, False], [‘Dropout’, (None, 128), 0, 0.5], [‘Dense’, (None, 5), 645, ‘linear’], [‘Activation’, (None, 5), 0]]  
—\> 21 comparator(summary(model), expectedModel)  
22  
23

~/work/W2A2/test\_utils.py in comparator(learner, instructor)  
21 “\n\n does not match the input value: \n\n”,  
22 colored(f"{a}", “red”))  
—\> 23 raise AssertionError(“Error in test”)  
24 print(colored(“All tests passed!”, “green”))  
25

AssertionError: Error in test

I’m quite sure that the error is in the way I call the first LSTM layer but I don’t understand what I’m doing wrong, this is the first part of my code:

{mentor edit: code removed}

---

<div class="post-metadata">

**Author:** ![MayankGhogale](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@MayankGhogale](https://community.deeplearning.ai/u/MayankGhogale)\
**Post date:** [April 7, 2022, 2:25am UTC](https://community.deeplearning.ai/t/c5-w2-a2-emojify/116841/2 "2022-04-07T02:25:13Z")

</div>

Can you pm me the notebook in pdf form  
Thanks

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [April 7, 2022, 2:25am UTC](https://community.deeplearning.ai/t/c5-w2-a2-emojify/116841/3 "2022-04-07T02:25:58Z")

</div>

There are two LSTM layers in that function. You could have an error in either one, or any of the code between them.

Please don’t post your code on the Forum. That breaks the course Honor Code.

---

<div class="post-metadata">

**Author:** ![Mitesh\_Lalwala](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@Mitesh\_Lalwala](https://community.deeplearning.ai/u/Mitesh_Lalwala)\
**Post date:** [October 18, 2022, 2:56pm UTC](https://community.deeplearning.ai/t/c5-w2-a2-emojify/116841/4 "2022-10-18T14:56:13Z")

</div>

Hi, I’m also having a similar problem. Can you please take a look at my notebook (Lab id - tixmogtm) and help me identify what’s wrong? Thank you.

---

<div class="post-metadata">

**Author:** ![MayankGhogale](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@MayankGhogale](https://community.deeplearning.ai/u/MayankGhogale)\
**Post date:** [October 18, 2022, 5:26pm UTC](https://community.deeplearning.ai/t/c5-w2-a2-emojify/116841/5 "2022-10-18T17:26:40Z")

</div>

I will surely have a look. Can you please PM me your notebook in pdf format as that would be easier for me to access  
Thanks and Regards,  
Mayank Ghogale

---

<div class="post-metadata">

**Author:** ![Juan\_Olano](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/juan_olano/32/27125_2.png) [@Juan\_Olano](https://community.deeplearning.ai/u/Juan_Olano)\
**Post date:** [October 18, 2022, 10:00pm UTC](https://community.deeplearning.ai/t/c5-w2-a2-emojify/116841/6 "2022-10-18T22:00:19Z")

</div>

Hi,

Although this may be already solved, the original post gives a clue to the possible solution. The post says:

Expected value

[‘LSTM’, (None, 4, 128), 67072, (None, 4, 2), ‘tanh’, True]

does not match the input value:

[‘LSTM’, (None, 128), 67072, (None, 4, 2), ‘tanh’, False]

It may be happening that the LSTM layer in question was set to request a batch sequence instead of a single hidden state.

I would check the last parameter of the LSTM layers to make sure the appropriate truth value is being passed.

Hopefully this helps someone.

Juan.

---

<div class="post-metadata">

**Author:** ![Mitesh\_Lalwala](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@Mitesh\_Lalwala](https://community.deeplearning.ai/u/Mitesh_Lalwala)\
**Post date:** [October 19, 2022, 6:34pm UTC](https://community.deeplearning.ai/t/c5-w2-a2-emojify/116841/7 "2022-10-19T18:34:46Z")

</div>

Thank you, Juan and Mayank.

I just restarted my kernel and re-run the whole notebook and it worked (without any change). So I guess it was some unrelated issue. But I appreciate your help.

Thanks,  
Mitesh
