Week 1 Assignment 3: Jazz, djmodel

Hello! I’m getting errors and would like to check if my dimensions are correct at least.

shape of X (None, 30, 90)
Before reshape, shape of x = (None, 90)
After reshape, shape of x = (None, 1, 90)

The assignment guideline says " * Recall that if you were implementing in numpy instead of Keras, you would extract a slice from a 3D numpy array like this:

var1 = array1[:,1,:]"

These directions are a bit unclear in that we are NOT using numpy instead of Keras, so I’m not sure if using the array1[:,1,:] notation is the right way to go about it. But this is the way that I did it, using “t” instead of “1”.

On running the djmodel function, the final error output is as shown below.

ValueError: Layer lstm_1 expects 27 inputs, but it received 3 input tensors. Inputs received: [<tf.Tensor ‘reshape_1/Reshape_40:0’ shape=(None, 1, 90) dtype=float32>, <tf.Tensor ‘a0_16:0’ shape=(None, 64) dtype=float32>, <tf.Tensor ‘c0_16:0’ shape=(None, 64) dtype=float32>]

Your shapes are correct.

Check whether you are doing the slicing correctly.


I did the same as BennyG, but I am getting the error that

[‘Reshape’, (None, 1, 90), 0]

does not match the input value:

[‘TensorFlowOpLayer’, [(None, 90)], 0]

@william27, this thread is two years cold. Lots has changed in the assignments since then.

Please post your question in a new thread, and include all of the information you have (i.e. screen capture images of any asserts or error messages). But do not post your code.

I’m closing this thread.