models icon indicating copy to clipboard operation
models copied to clipboard

ConcatOp : Dimensions of inputs should match: shape[0] = [1,1700,5] vs. shape[2] = [1,2112,8]

Open purveshsharma50 opened this issue 6 years ago • 5 comments

InvalidArgumentError Traceback (most recent call last) in 4 #y_pred = model.predict(np.array(batch_images).reshape(1)) 5 ----> 6 y_pred = model.predict(batch_images) 7 8

~/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/engine/training.py in _method_wrapper(self, *args, **kwargs) 86 raise ValueError('{} is not supported in multi-worker mode.'.format( 87 method.name)) ---> 88 return method(self, *args, **kwargs) 89 90 return tf_decorator.make_decorator(

~/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/engine/training.py in predict(self, x, batch_size, verbose, steps, callbacks, max_queue_size, workers, use_multiprocessing) 1266 for step in data_handler.steps(): 1267 callbacks.on_predict_batch_begin(step) -> 1268 tmp_batch_outputs = predict_function(iterator) 1269 # Catch OutOfRangeError for Datasets of unknown size. 1270 # This blocks until the batch has finished executing.

~/anaconda3/lib/python3.7/site-packages/tensorflow/python/eager/def_function.py in call(self, *args, **kwds) 578 xla_context.Exit() 579 else: --> 580 result = self._call(*args, **kwds) 581 582 if tracing_count == self._get_tracing_count():

~/anaconda3/lib/python3.7/site-packages/tensorflow/python/eager/def_function.py in _call(self, *args, **kwds) 616 # In this case we have not created variables on the first call. So we can 617 # run the first trace but we should fail if variables are created. --> 618 results = self._stateful_fn(*args, **kwds) 619 if self._created_variables: 620 raise ValueError("Creating variables on a non-first call to a function"

~/anaconda3/lib/python3.7/site-packages/tensorflow/python/eager/function.py in call(self, *args, **kwargs) 2418 with self._lock: 2419 graph_function, args, kwargs = self._maybe_define_function(args, kwargs) -> 2420 return graph_function._filtered_call(args, kwargs) # pylint: disable=protected-access 2421 2422 @property

~/anaconda3/lib/python3.7/site-packages/tensorflow/python/eager/function.py in _filtered_call(self, args, kwargs) 1663 if isinstance(t, (ops.Tensor, 1664 resource_variable_ops.BaseResourceVariable))), -> 1665 self.captured_inputs) 1666 1667 def _call_flat(self, args, captured_inputs, cancellation_manager=None):

~/anaconda3/lib/python3.7/site-packages/tensorflow/python/eager/function.py in _call_flat(self, args, captured_inputs, cancellation_manager) 1744 # No tape is watching; skip to running the function. 1745 return self._build_call_outputs(self._inference_function.call( -> 1746 ctx, args, cancellation_manager=cancellation_manager)) 1747 forward_backward = self._select_forward_and_backward_functions( 1748 args,

~/anaconda3/lib/python3.7/site-packages/tensorflow/python/eager/function.py in call(self, ctx, args, cancellation_manager) 596 inputs=args, 597 attrs=attrs, --> 598 ctx=ctx) 599 else: 600 outputs = execute.execute_with_cancellation(

~/anaconda3/lib/python3.7/site-packages/tensorflow/python/eager/execute.py in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name) 58 ctx.ensure_initialized() 59 tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name, ---> 60 inputs, attrs, num_outputs) 61 except core._NotOkStatusException as e: 62 if name is not None:

InvalidArgumentError: ConcatOp : Dimensions of inputs should match: shape[0] = [1,1700,5] vs. shape[2] = [1,2112,8] [[node model/predictions/concat (defined at :6) ]] [Op:__inference_predict_function_9121]

Function call stack: predict_function

purveshsharma50 avatar Sep 26 '20 08:09 purveshsharma50

@purveshsharma50

Please, refer this link and see if it helps you.

Still if your issue is not resolved please share reproducible code or colab link to investigate further. Thanks!

ravikyram avatar Sep 28 '20 11:09 ravikyram

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

google-ml-butler[bot] avatar Oct 05 '20 11:10 google-ml-butler[bot]

Closing as stale. Please reopen if you'd like to work on this further.

google-ml-butler[bot] avatar Oct 12 '20 11:10 google-ml-butler[bot]

Are you satisfied with the resolution of your issue? Yes No

google-ml-butler[bot] avatar Oct 12 '20 11:10 google-ml-butler[bot]