Course 5 Week 3 UNQ_C2: Getting NoneType for model output

Hi All: When I run my code for modelf I get the error:

in
34
35
—> 36 modelf_test(modelf)

in modelf_test(target)
29 [‘Dense’, (None, 11), 715, ‘softmax’]]
30
—> 31 assert len(model.outputs) == 10, f"Wrong output shape. Expected 10 != {len(model.outputs)}"
32
33 comparator(summary(model), expected_summary)

TypeError: object of type ‘NoneType’ has no len()

As I was debugging I noticed that all my inputs/hidden state/cell/states have "None" as their first dimention (ie "a.shape" = (None, 30, 64) and "context.shape" = (None, 1,64)) all the time.   I can't figure out what I am doing wrong.   Does anyone have any ideas?

Thanks!

Model should be constructed with both inputs and outputs. It seems like you are not providing outputs. Please confirm.

1 Like

No I wasn’t :(. Thank you - it worked when I added it!

Thanks!