Exercise 5 - Emojify_V2

Hello!

I’m struggling to implement Emojify_V2(). I get the following traceback:


I’d appreciate any help.

Thanks in advance!

I added some print statements in that function and here’s what I see:

type(sentence_indices) <class 'tensorflow.python.framework.ops.Tensor'>
input_shape (4,)
After dropout and before LSTM X.shape = (None, 4, 128)
All tests passed!

It looks like your X value is missing the second dimension of 4, so how could that happen?

Have a careful look the comments in the template code and the instructions: there are a couple of ways in which what we can see of your code from the exception trace does not match what they are saying here. E.g. the first LSTM returns a sequence, but the second one (the one that is “throwing” for you) does not, right?

Actually it’s worse than that: note they are asking for a Dense layer at that line, not another instance of LSTM, right?

1 Like

@paulinpaloalto thanks for help. My mistake was that I used LSTM layer instead of a Dense layer. I also made an error in applying Activation().

2 Likes