Music_inference_model error

Hi all.

I got this error and couldnt be able to solve it. anyone can help?

AssertionError                            Traceback (most recent call last)
<ipython-input-15-a33998d93c7b> in <module>
----> 1 inference_model = music_inference_model(LSTM_cell, densor, Ty = 50)

<ipython-input-14-3c8e3d1ad670> in music_inference_model(LSTM_cell, densor, Ty)
     56 
     57     # Step 3: Create model instance with the correct "inputs" and "outputs" (≈1 line)
---> 58     inference_model = Model(inputs=[x, a, c], outputs=outputs)
     59 
     60     ### END CODE HERE ###

/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/training.py in __new__(cls, *args, **kwargs)
    240       # Functional model
    241       from tensorflow.python.keras.engine import functional  # pylint: disable=g-import-not-at-top
--> 242       return functional.Functional(*args, **kwargs)
    243     else:
    244       return super(Model, cls).__new__(cls, *args, **kwargs)

/opt/conda/lib/python3.7/site-packages/tensorflow/python/training/tracking/base.py in _method_wrapper(self, *args, **kwargs)
    455     self._self_setattr_tracking = False  # pylint: disable=protected-access
    456     try:
--> 457       result = method(self, *args, **kwargs)
    458     finally:
    459       self._self_setattr_tracking = previous_value  # pylint: disable=protected-access

/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/functional.py in __init__(self, inputs, outputs, name, trainable)
    113     #     'arguments during initialization. Got an unexpected argument:')
    114     super(Functional, self).__init__(name=name, trainable=trainable)
--> 115     self._init_graph_network(inputs, outputs)
    116 
    117   @trackable.no_automatic_dependency_tracking

/opt/conda/lib/python3.7/site-packages/tensorflow/python/training/tracking/base.py in _method_wrapper(self, *args, **kwargs)
    455     self._self_setattr_tracking = False  # pylint: disable=protected-access
    456     try:
--> 457       result = method(self, *args, **kwargs)
    458     finally:
    459       self._self_setattr_tracking = previous_value  # pylint: disable=protected-access

/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/functional.py in _init_graph_network(self, inputs, outputs)
    182       # It's supposed to be an input layer, so only one node
    183       # and one tensor output.
--> 184       assert node_index == 0
    185       assert tensor_index == 0
    186       self._input_layers.append(layer)

AssertionError: ```

Hi Murat,

The Model object expects the original input of the model, the initial hidden state and the initial cell state. See if you can find how to provide those. Good luck!

actually this error came from the line that I didnt write (created from tutors). how can I change it?

Hi murat,

Look at the provided code for music_inference_model.

Which variable is used to define the input of the model, and remains unchanged in the code up to the definition of the model?

Which variables are used to define the initial hidden state and remain unchanged in the code up to the definition of the model?

These are the variables you have to include in the construction of the Model instance, i.e., the initial inputs.