Hi,
Can you please help?
I got this error when running the djmodel. Have read other posts. Looked like that the outputs concatenation was wrong. I created an empty list as outputs before the loop. “a” was passed into the densor layer. How to fix it? Thanks!
model = djmodel(Tx=30, LSTM_cell=LSTM_cell, densor=densor, reshaper=reshaper).
Error Traceback
Tensor(“dense/Softmax_5:0”, shape=(None, 90), dtype=float32)
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: Dimensions must be equal, but are 0 and 90 for ‘{{node AddV2_1}} = AddV2[T=DT_FLOAT](AddV2_1/x, dense/Softmax_5)’ with input shapes: [0], [?,90].
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
in
----> 1 model = djmodel(Tx=30, LSTM_cell=LSTM_cell, densor=densor, reshaper=reshaper)
in djmodel(Tx, LSTM_cell, densor, reshaper)
51 print(out)
52 # Step 2.E: add the output to “outputs”
—> 53 outputs = outputs + out
54
55 # Step 3: Create model instance
/opt/conda/lib/python3.7/site-packages/tensorflow/python/ops/math_ops.py in r_binary_op_wrapper(y, x)
1154 with ops.name_scope(None, op_name, [x, y]) as name:
1155 x = ops.convert_to_tensor(x, dtype=y.dtype.base_dtype, name=“x”)
→ 1156 return func(x, y, name=name)
1157
1158 # Propagate func.doc to the wrappers
/opt/conda/lib/python3.7/site-packages/tensorflow/python/util/dispatch.py in wrapper(*args, **kwargs)
199 “”“Call target, and fall back on dispatchers if there is a TypeError.”""
200 try:
→ 201 return target(*args, **kwargs)
202 except (TypeError, ValueError):
203 # Note: convert_to_eager_tensor currently raises a ValueError, not a
/opt/conda/lib/python3.7/site-packages/tensorflow/python/ops/math_ops.py in _add_dispatch(x, y, name)
1445 return gen_math_ops.add(x, y, name=name)
1446 else:
→ 1447 return gen_math_ops.add_v2(x, y, name=name)
1448
1449
/opt/conda/lib/python3.7/site-packages/tensorflow/python/ops/gen_math_ops.py in add_v2(x, y, name)
494 # Add nodes to the TensorFlow graph.
495 _, _, _op, _outputs = _op_def_library._apply_op_helper(
→ 496 “AddV2”, x=x, y=y, name=name)
497 _result = _outputs[:]
498 if _execute.must_record_gradient():
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/op_def_library.py in _apply_op_helper(op_type_name, name, **keywords)
742 op = g._create_op_internal(op_type_name, inputs, dtypes=None,
743 name=scope, input_types=input_types,
→ 744 attrs=attr_protos, op_def=op_def)
745
746 # outputs
is returned as a separate return value so that the output
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/func_graph.py in _create_op_internal(self, op_type, inputs, dtypes, input_types, name, attrs, op_def, compute_device)
591 return super(FuncGraph, self)._create_op_internal( # pylint: disable=protected-access
592 op_type, inputs, dtypes, input_types, name, attrs, op_def,
→ 593 compute_device)
594
595 def capture(self, tensor, name=None, shape=None):
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/ops.py in _create_op_internal(self, op_type, inputs, dtypes, input_types, name, attrs, op_def, compute_device)
3483 input_types=input_types,
3484 original_op=self._default_original_op,
→ 3485 op_def=op_def)
3486 self._create_op_helper(ret, compute_device=compute_device)
3487 return ret
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/ops.py in init(self, node_def, g, inputs, output_types, control_inputs, input_types, original_op, op_def)
1973 op_def = self._graph._get_op_def(node_def.op)
1974 self._c_op = _create_c_op(self._graph, node_def, inputs,
→ 1975 control_input_ops, op_def)
1976 name = compat.as_str(node_def.name)
1977 # pylint: enable=protected-access
/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: Dimensions must be equal, but are 0 and 90 for ‘{{node AddV2_1}} = AddV2[T=DT_FLOAT](AddV2_1/x, dense/Softmax_5)’ with input shapes: [0], [?,90].