Course 5 Week 1 Assignment 1 (Jazz) Exercise 1 'NoneType' object has no attribute 'append'

I have been stuck for hours. Please suggest what should I change.

AttributeError Traceback (most recent call last)
----> 1 model = djmodel(Tx=30, LSTM_cell=LSTM_cell, densor=densor, reshaper=reshaper)

in djmodel(Tx, LSTM_cell, densor, reshaper)
52 print(out)
53 # Step 2.E: add the output to “outputs”
—> 54 outputs = outputs.append(out)
55 print(outputs)

AttributeError: ‘NoneType’ object has no attribute ‘append’

Here is a.shape, out, outputs, printed respectively.
(None, 64)
Tensor(“dense_1/Softmax_19:0”, shape=(None, 90), dtype=float32)

1 Like

Hi @WuSM,

I have moved this post to the DLS Course 5 category as other learners taking the same course might benefit from this.

Kindly make sure if you have any course-specific queries, explore the specialization category and post in the relevant course subcategory as course-specific mentors are actively answering the queries there. The General Discussions category is not monitored by our mentors.

If you are unclear about how to use Discourse, we have made this guide for our learners. I believe that reading this will help you out posting in the appropriate categories next time!

Happy Learning!!

Did you initialize the outputs variable to an empty array?

Yes, I did initialize outputs to .

It works fine after removing ‘outputs =’ from outputs.append(out) line.