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.

Image classification: could not broadcast input array from shape into shape

See original GitHub issue

Receiving this error trying to run a simple image classification example

  File "/Users/colinpetit/.pyenv/versions/3.6.5/lib/python3.6/site-packages/ludwig/features/image_feature.py", line 101, in add_feature_data
    data[feature['name']][i, :, :, :] = img
ValueError: could not broadcast input array from shape (743,620,3) into shape (383,442,4)

model_definition_file:

input_features:
  -
    name: img
    type: image
    encoder: stacked_cnn
output_features:
  -
    name: type
    type: category
training:
  epochs: 10

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
w4nderlustcommented, Feb 17, 2019

Thanks @mattarderne for confirming it, will work on a patch that solves this issue, it will be pretty straightforward.

1reaction
w4nderlustcommented, Feb 15, 2019

I have to specify this better in the docs: Either your images are all of the same size, or you have to resize them to the same size by specifying the resize_method, width and height parameters as explained here. Let me know if this solves your issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting an error saying " could not broadcast input array from ...
I am working on an image classification problem where I have to deal with input images of 19 channels. I was successful in...
Read more >
could not broadcast input array from shape (1600,860,3) into ...
I am trying to extract image feature but i keep gives me this error: Traceback (most recent call last): File ...
Read more >
ValueError could not broadcast input array from shape 360 ...
In the above error it shows could not broadcast input array from shape (360,270,3) into shape (360,280,3), means you are tying to exchange ......
Read more >
Could not broadcast input array from shape - Faceswap Forum
Hi,. I have an error when I try to train my model : 01/04/2021 09:22:42 ERROR Caught exception in thread: '_training_0'
Read more >
ValueError: could not broadcast input array from shape ...
I have tried to downscale the input volume to 128 and restarted and still the error persists with the refinement. I would appreciate...
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