Course 5 W1A3 - I'm stucked

I’m getting this error.


TypeError Traceback (most recent call last)
in
1 ### YOU CANNOT EDIT THIS CELL
----> 2 inference_model = music_inference_model(LSTM_cell, densor, Ty = 50)

in music_inference_model(LSTM_cell, densor, Ty)
54 x = RepeatVector(1)(x)
55 # Step 3: Create model instance with the correct “inputs” and “outputs” (≈1 line)
—> 56 inference_model = model(inputs=[x0, a0, c0], outputs=densor)
57
58 ### END CODE HERE ###

/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py in call(self, *args, **kwargs)
924 if _in_functional_construction_mode(self, inputs, args, kwargs, input_list):
925 return self._functional_construction_call(inputs, args, kwargs,
→ 926 input_list)
927
928 # Maintains info about the Layer.call stack.

/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py in _functional_construction_call(self, inputs, args, kwargs, input_list)
1115 try:
1116 with ops.enable_auto_cast_variables(self._compute_dtype_object):
→ 1117 outputs = call_fn(cast_inputs, *args, **kwargs)
1118
1119 except errors.OperatorNotAllowedInGraphError as e:

TypeError: call() got an unexpected keyword argument ‘outputs’

I guess that error is in calling:

               inference_model =  model(inputs=[x, a, c], outputs=output)

The HINT says: Hint : the inputs to the model are the initial inputs and states.

But I don’t understand what are the correct initial inputs.

Can you help me ?

Hello @Dalton_Lintz,

I think the error is due to typo. We use tf.keras.models.Model (or in short Model as defined in the assignment) to build a model object, but you used model (defined earlier in the globa scope) which is itself a model object to do the building work, so it failed.

image

Cheers,
Raymond
PS: I also spotted another thing in that line.

You are correct Raymond, it’s a typo. What I’m trying is

model(inputs=[x, a, c], outputs=out)

But the error message is the same.

I get it !!! It’s working now . Thank you Raymond

That’s great, @Dalton_Lintz!

Raymond