question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Input array dimensions not matching

See original GitHub issue

I am trying to run PredNet using the pre-processed data and the pretrained model, nothing modified in the code. (Unrelated: It would be nice to indicate somewhere that your model doesn’t support Python 3! Or maybe it was written and I missed it?)

For

python kitti_evaluate.py

I get the following error:

Using Theano backend.
Traceback (most recent call last):
  File "kitti_evaluate.py", line 52, in <module>
    X_hat = test_model.predict(X_test, batch_size)
  File "//anaconda/lib/python2.7/site-packages/keras/engine/training.py", line 1197, in predict
    batch_size=batch_size, verbose=verbose)
  File "//anaconda/lib/python2.7/site-packages/keras/engine/training.py", line 896, in _predict_loop
    batch_outs = f(ins_batch)
  File "//anaconda/lib/python2.7/site-packages/keras/backend/theano_backend.py", line 792, in __call__
    return self.function(*inputs)
  File "//anaconda/lib/python2.7/site-packages/theano/compile/function_module.py", line 871, in __call__
    storage_map=getattr(self.fn, 'storage_map', None))
  File "//anaconda/lib/python2.7/site-packages/theano/gof/link.py", line 314, in raise_with_op
    reraise(exc_type, exc_value, exc_trace)
  File "//anaconda/lib/python2.7/site-packages/theano/compile/function_module.py", line 859, in __call__
    outputs = self.fn()
  File "//anaconda/lib/python2.7/site-packages/theano/scan_module/scan_op.py", line 951, in rval
    r = p(n, [x[0] for x in i], o)
  File "//anaconda/lib/python2.7/site-packages/theano/scan_module/scan_op.py", line 940, in <lambda>
    self, node)
  File "theano/scan_module/scan_perform.pyx", line 405, in theano.scan_module.scan_perform.perform (/Users/lana/.theano/compiledir_Darwin-15.6.0-x86_64-i386-64bit-i386-2.7.10-64/scan_perform/mod.cpp:4316)
  File "//anaconda/lib/python2.7/site-packages/theano/gof/link.py", line 314, in raise_with_op
    reraise(exc_type, exc_value, exc_trace)
  File "theano/scan_module/scan_perform.pyx", line 397, in theano.scan_module.scan_perform.perform (/Users/lana/.theano/compiledir_Darwin-15.6.0-x86_64-i386-64bit-i386-2.7.10-64/scan_perform/mod.cpp:4193)
ValueError: all the input array dimensions except for the concatenation axis must match exactly
Apply node that caused the error: Join(TensorConstant{1}, <TensorType(float32, 4D)>, <TensorType(float32, 4D)>, Reshape{4}.0)
Toposort index: 61
Inputs types: [TensorType(int8, scalar), TensorType(float32, 4D), TensorType(float32, 4D), TensorType(float32, 4D)]
Inputs shapes: [(), (10, 96, 32, 40), (10, 192, 32, 40), (10, 384, 32, 20)]
Inputs strides: [(), (491520, 5120, 160, 4), (983040, 5120, 160, 4), (983040, 2560, 80, 4)]
Inputs values: [array(1, dtype=int8), 'not shown', 'not shown', 'not shown']
Outputs clients: [[CorrMM{half, (1, 1)}(Join.0, Subtensor{::, ::, ::int64, ::int64}.0), CorrMM{half, (1, 1)}(Join.0, Subtensor{::, ::, ::int64, ::int64}.0), CorrMM{half, (1, 1)}(Join.0, Subtensor{::, ::, ::int64, ::int64}.0), CorrMM{half, (1, 1)}(Join.0, Subtensor{::, ::, ::int64, ::int64}.0)]]

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:17 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
LanaSinacommented, Nov 25, 2016

There is a default setting in the keras.json file in .keras mine had as default

“image_dim_ordering”: “tf”,

I just changed it back to th. Everything works now. In the end @bill-lotter 's 1st message was very close to the issue - it wasn’t K.dim_ordering or the backend setting itself, but image_dim_ordering. I will mark the issue as closed.

0reactions
bill-lottercommented, Nov 26, 2016

Sorry about this, I tried to make it compatible with both dimension orderings (e.g. https://github.com/coxlab/prednet/blob/master/data_utils.py#L22), but guess it didn’t work. I’ll work to make it compatible for both.

Read more comments on GitHub >

github_iconTop Results From Across the Web

all the input array dimensions for the concatenation axis must ...
I am getting the error ValueError: all the input array dimensions for the concatenation axis must match exactly, but along ...
Read more >
Fixing ValueError: All the Input Array Dimensions Except for ...
Read the article to understand and fix valueerror: all the input array dimensions except for the concatenation axis must match exactly error.
Read more >
How to Fix: All input arrays must have same number of ...
When we are using concatenate function in the NumPy library for NumPy arrays the dimensions of both the arrays must match while concatenating....
Read more >
Solved: Array Dimensions Do Not Match - PTC Community
I just get the "Array Dimensions Do Not Match" error however as shown in the attachment, the dimensions clearly match.
Read more >
ERP Data export "input array dimensions do not match" - Support ...
ValueError : all the input array dimensions for the concatenation axis must match exactly, but along dimension 1, the array at index 0...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found