C4_W1: Problem with UNQ_C7

I passed UNQ_C7 but system don’t grade for me. I think it is a problem in UNQ_C6(passed), in line

output, _ = NMTAttn((input_tokens, padded_with_batch))

. But when I test UNQ_C10, it arises error like image below, Why we can’t use the line like this: output, _ = NMTAttn()((input_tokens, padded_with_batch)). Tks everyone.


UNQ_C6

GRADED

Hi @Sonny2

Welcome to community!

If we are talking about UNQ_C6, NMTAttn is passed as an argument ("An LSTM sequence-to-sequence model with attention.) In other words it already is NMTAttn() in the scope of this function.

Regarding your error, you might be using model instead of NMTAttn (if the tests passed but grading did not). Please check for that.

Cheers

I still got this problem

Do not change the code outside the ### START CODE HERE ### and ### END CODE HERE ### .
You changed the # UNIT TEST part which is not good.

My guess of your error was based that you received the error “‘NoneType’ object is not callable” which suggests that you try to call NMTAttn which is None. Which is strange, because that is the argument of the next_symbol (so you might have used 'modelinstead ofNMTAttn` in UNQ_C10).

But that might not be the only reason - either your UNQ_C4 does not return a model (None in this case) something else :slight_smile:

First check if UNQ_C4 output is exactly the same as “Expected output”. If that is the case, you should search for the reason why NMTAttn is None in this test (multiple ways to go wrong, especially if you changed the code outside where you supposed to).

So let me know if you checked for these points.

Cheers

1 Like