Getting below error in music_inference_model function:-
WARNING:tensorflow:Model was constructed with shape (None, 30, 90) for input Tensor(“input_1:0”, shape=(None, 30, 90), dtype=float32), but it was called on an input with incompatible shape (None, 1, 90).
InvalidArgumentError Traceback (most recent call last)
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/ops.py in _create_c_op(graph, node_def, inputs, control_inputs, op_def)
1811 try:
→ 1812 c_op = pywrap_tf_session.TF_FinishOperation(op_desc)
1813 except errors.InvalidArgumentError as e:
InvalidArgumentError: slice index 1 of dimension 1 out of bounds. for ‘{{node functional_1/tf_op_layer_strided_slice_1/strided_slice_1_3}} = StridedSlice[Index=DT_INT32, T=DT_FLOAT, _cloned=true, begin_mask=5, ellipsis_mask=0, end_mask=5, new_axis_mask=0, shrink_axis_mask=2](input_7, functional_1/tf_op_layer_strided_slice_1/strided_slice_1/begin_3, functional_1/tf_op_layer_strided_slice_1/strided_slice_1/end_3, functional_1/tf_op_layer_strided_slice_1/strided_slice_1/strides_3)’ with input shapes: [?,1,90], [3], [3], [3] and with computed input tensors: input[1] = <0 1 0>, input[2] = <0 2 0>, input[3] = <1 1 1>.
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
in
----> 1 inference_model = music_inference_model(LSTM_cell, densor, Ty = 50)
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([x0, a0, c0],outputs)
59
60 ### 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:
/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/functional.py in call(self, inputs, training, mask)
384 “”"
385 return self._run_internal_graph(
→ 386 inputs, training=training, mask=mask)
387
388 def compute_output_shape(self, input_shape):
/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/functional.py in _run_internal_graph(self, inputs, training, mask)
506
507 args, kwargs = node.map_arguments(tensor_dict)
→ 508 outputs = node.layer(*args, **kwargs)
509
510 # Update tensor_dict.
/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:
/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py in call(self, inputs)
3097 if context.executing_eagerly():
3098 return self._defun_call(inputs)
→ 3099 return self._make_op(inputs)
3100
3101 def _make_node_def(self, graph):
/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py in _make_op(self, inputs)
3119 constant = constant_op.constant(value, name=node_def.input[index])
3120 inputs.insert(index, constant)
→ 3121 c_op = ops._create_c_op(graph, node_def, inputs, control_inputs=)
3122 op = graph._create_op_from_tf_operation(c_op)
3123 op._control_flow_post_processing()
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/ops.py in _create_c_op(graph, node_def, inputs, control_inputs, op_def)
1813 except errors.InvalidArgumentError as e:
1814 # Convert to ValueError for backwards compatibility.
→ 1815 raise ValueError(str(e))
1816
1817 return c_op
ValueError: slice index 1 of dimension 1 out of bounds. for ‘{{node functional_1/tf_op_layer_strided_slice_1/strided_slice_1_3}} = StridedSlice[Index=DT_INT32, T=DT_FLOAT, _cloned=true, begin_mask=5, ellipsis_mask=0, end_mask=5, new_axis_mask=0, shrink_axis_mask=2](input_7, functional_1/tf_op_layer_strided_slice_1/strided_slice_1/begin_3, functional_1/tf_op_layer_strided_slice_1/strided_slice_1/end_3, functional_1/tf_op_layer_strided_slice_1/strided_slice_1/strides_3)’ with input shapes: [?,1,90], [3], [3], [3] and with computed input tensors: input[1] = <0 1 0>, input[2] = <0 2 0>, input[3] = <1 1 1>.