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.

all the input arrays must have same number of dimensions

See original GitHub issue

🐛 Bug

To Reproduce

Steps to reproduce the behavior:

when i use the notebook from https://github.com/qubvel/segmentation_models/blob/master/examples/multiclass segmentation (camvid).ipynb, with Resize transform turn on, raises the above error.

Expected behavior

Environment

  • Albumentations version (0.3.3):
  • Python version (3.6):
  • OS (Linux):
  • How you installed albumentations (pip):
  • Any other relevant information: segmentation models version(1.0.0)

Additional context

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
nsfabinacommented, Sep 19, 2019

I’m pretty sure the fix here is:

Currently:

~/miniconda3/envs/asu/lib/python3.7/site-packages/albumentations/augmentations/functional.py in __process_fn(img)
    157                 chunk = process_fn(chunk, **kwargs)
    158                 chunks.append(chunk)
--> 159             img = np.concatenate(chunks, axis=2)
    160         else:
    161             img = process_fn(img, **kwargs)

Becomes:

~/miniconda3/envs/asu/lib/python3.7/site-packages/albumentations/augmentations/functional.py in __process_fn(img)
    157                 chunk = process_fn(chunk, **kwargs)
    158                 chunks.append(chunk)
--> 159             img = np.dstack(chunks)
    160         else:
    161             img = process_fn(img, **kwargs)
0reactions
Dipetcommented, Sep 23, 2019

Fixed #364

Read more comments on GitHub >

github_iconTop Results From Across the Web

all the input arrays must have same number of dimensions ...
If I start with a 3x4 array, and concatenate a 3x1 array, with axis 1, I get a 3x5 array: In [911]: x...
Read more >
How to Fix: All input arrays must have same number of ...
This error can be fixed by making the dimensions of both the arrays the same if we want to use concatenate function only....
Read more >
All input arrays must have same number of dimensions
This tutorial explains how to fix the following error in NumPy: ValueError: all the input arrays must have same number of dimensions.
Read more >
the input arrays must have same number of dimensions, but ...
I'm in page 125 and the code tries to concatenate an np array using some kinda-hardcore tuples using some keras data batches. My...
Read more >
got error all the input arrays must have same number ... - GitHub
got error all the input arrays must have same number of dimensions, but the array at index 0 has 2 dimension(s) and the...
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