ValueError: could not broadcast input array from shape (96,96,4) into shape (96,96)
See original GitHub issueI’m having the similar trouble as in #26. Not sure if I’m doing something wrong or if there’s a fix. I’m using my own image dataset all scaled to 96x96. Stack trace below.
Image:
PNG 96x96 96x96+0+0 8-bit sRGB 7.2KB 0.000u 0:00.000
Traceback (most recent call last):
File "main.py", line 99, in <module>
tf.app.run()
File "/home/ubuntu/.local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 44, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "main.py", line 82, in main
dcgan.train(FLAGS)
File "/home/ubuntu/GANs/model.py", line 186, in train
sample_inputs = np.array(sample).astype(np.float32)
Issue Analytics
- State:
- Created 6 years ago
- Comments:28 (1 by maintainers)
Top Results From Across the Web
ValueError: could not broadcast input array from shape ...
At least one item in your list is either not three dimensional, or its second or third dimension does not match the other...
Read more >Valueerror: could not broadcast input array from shape
The error message "Valueerror: could not broadcast input array from shape" basically means that pandas won't be able to remove two data frames...
Read more >Could Not Broadcast Input Array From Shape (27839,1) Into ...
ValueError : could not broadcast input array from shape 96964 into shape in main dcgan.trainFLAGS File /home/ubuntu/GANs/model.py line is 400x300x3 and JPEG but ......
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 >Python Error ""ValueError: could not broadcast input array ...
Your data generator retrieves your labels as categorical and based on the error, I assume you have 4 classes.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had the same problem before. It is because there are grey scale images in my data. I solved this by:
Simply converting grey scale image to RGB image is OK.
I was able to fix this issue by:
After I took care of these, it worked.