Week 1 Jazz Model error: InvalidArgumentError: Incompatible shapes: [31,256] vs. [32,256]

Hi,

I’m working on the LSTM Jazz assignment. I run the following line:

history = model.fit([X, a0, c0], list(Y), epochs=100, verbose = 0)

and get the following error:

InvalidArgumentError:    Incompatible shapes: [31,256] vs. [32,256]
	 [[{{node while_24/body/_1/while/add}}]]
	 [[functional_1/lstm/PartitionedCall]] [Op:__inference_train_function_78614]

Function call stack:
train_function -> train_function -> train_function

Any thoughts ? My code passes the unit test before this step. Thank you!

1 Like

There is likely an error in your code for djmodel().

1 Like

Also, are you running the code on Coursera Labs, or are you running the notebook on some other platform?

1 Like

I am running the code in my browser ( by clicking “launch lab” ). Thanks for the quick response! Could you please suggest what I could try to print / verify in order to discover what may be wrong with my djmodel implementation?

Thanks a lot!

1 Like

Hi, I found that I had a trivial error in my code. All fixed now, thank you!

4 Likes