W1 A3 music_inference_model function not working

Hi everyone,

I’m struggling with the function music_inference_model.

I’m getting this error:

Test failed at index 4

Expected value
['TensorFlowOpLayer', [(None,)], 0] 

does not match the input value: 
['Dense', (None, 90), 5850, 'softmax']

the model is also generating with the wrong amount of parameters:
I’m getting:

Total params: 39,680
Trainable params: 39,680
Non-trainable params: 0

instead of

Total params: 45,530
Trainable params: 45,530
Non-trainable params: 0

I’ve looked at other answer on here and tried printing x.shape at various positions:

before LSTM_cell: (None, 1, 90)
after LSTM_cell: (None, 1, 90)
after argmax: (None,)
after one_hot: (None, 90)

any help would be really appreciated.

Did you use the densor(…) function in Step 2.B?


        out = densor(a)


  • In argmax(…), use the correct axis value.
  • In one_hot(…), avoid using a hard-coded value for the depth.

Another possibility (something I did): Did you sample the correct variable?