# Emojify\_V2 Expected values does not match input value

**URL:** <https://community.deeplearning.ai/t/emojify-v2-expected-values-does-not-match-input-value/419352>\
**Category:** Sequence Models\
**Tags:** coursera-platform\
**Created:** [August 16, 2023, 1:34pm UTC](https://community.deeplearning.ai/t/emojify-v2-expected-values-does-not-match-input-value/419352 "2023-08-16T13:34:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![J\_W](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@J\_W](https://community.deeplearning.ai/u/J_W)\
**Post date:** [August 16, 2023, 1:34pm UTC](https://community.deeplearning.ai/t/emojify-v2-expected-values-does-not-match-input-value/419352/1 "2023-08-16T13:34:09Z")

</div>

I am having a hard time figuring out what I got wrong on this workbook. I get the following error. I recognize that I somehow need to revise the LSTM layer, but I am unsure how. I would appreciate guidance.

```auto
Layer (type) Output Shape Param # Connected to                     
==================================================================================================
input_9 (InputLayer) [(None, 4)] 0                                            
__________________________________________________________________________________________________
embedding_10 (Embedding) (None, 4, 2) 30 input_9[0][0]                    
__________________________________________________________________________________________________
lstm_10 (LSTM) (None, 4, 128) 67072 embedding_10[0][0]               
__________________________________________________________________________________________________
dropout_10 (Dropout) (None, 4, 128) 0 lstm_10[0][0]                    
__________________________________________________________________________________________________
lstm_11 (LSTM) [(None, 128), (None, 131584 dropout_10[0][0]                 
__________________________________________________________________________________________________
dropout_11 (Dropout) (3, None, 128) 0 lstm_11[0][0]                    
                                                                 lstm_11[0][1]                    
                                                                 lstm_11[0][2]                    
__________________________________________________________________________________________________
dense_5 (Dense) (3, None, 5) 645 dropout_11[0][0]                 
__________________________________________________________________________________________________
activation_5 (Activation) (3, None, 5) 0 dense_5[0][0]                    
==================================================================================================
Total params: 199,331
Trainable params: 199,301
Non-trainable params: 30
__________________________________________________________________________________________________
None
Test failed 
 Expected value 

 ['LSTM', (None, 128), 131584, (None, 4, 128), 'tanh', False] 

 does not match the input value: 

 ['LSTM', [(None, 128), (None, 128), (None, 128)], 131584, (None, 4, 128), 'tanh', False]

```

---

<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 16, 2023, 6:13pm UTC](https://community.deeplearning.ai/t/emojify-v2-expected-values-does-not-match-input-value/419352/2 "2023-08-16T18:13:31Z")

</div>

Here are some hints:

1. Output shape of the 2nd lstm layer is incorrect. Since the 2nd LSTM layer only returns the output for the last sequence, the output shape should be `(None, #units)` where `None` corresponds to batch dimension and `#units` = 128.
2. Since dropout only zeros parts of input, the output shape of dropout should match the output shape of the 2nd lstm layer.
3. Output shape of the `Dense` layer should be `(None, # units in dense layer)`.
4. Activation layer should not change the output shape.
