jeffheaton / t81_558_deep_learning

T81-558: Keras - Applications of Deep Neural Networks @Washington University in St. Louis
https://sites.wustl.edu/jeffheaton/t81-558/
Other
5.71k stars 3.04k forks source link

Value Error while broadcasting #71

Closed ghost closed 4 years ago

ghost commented 4 years ago

Expected Output : Saving the training dataset Traceback : Traceback (most recent call last): File "loadimages.py", line 28, in <module> training_ds = np.reshape(training_ds,(-1,GENERATE_SQUARE,GENERATE_SQUARE,IMAGE_CHANNELS)) File "<__array_function__ internals>", line 5, in reshape File "/home/chr0m0s0m3s/.local/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 299, in reshape return _wrapfunc(a, 'reshape', newshape, order=order) File "/home/chr0m0s0m3s/.local/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 55, in _wrapfunc return _wrapit(obj, method, *args, **kwds) File "/home/chr0m0s0m3s/.local/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 44, in _wrapit result = getattr(asarray(obj), method)(*args, **kwds) File "/home/chr0m0s0m3s/.local/lib/python3.8/site-packages/numpy/core/_asarray.py", line 83, in asarray return array(a, dtype, copy=False, order=order) ValueError: could not broadcast input array from shape (480,480,3) into shape (480,480)

jeffheaton commented 4 years ago

What were you trying to do when you got this error?

ghost commented 4 years ago

im trying to load a number of images(.jpg) from a specific folder with 480 px each after resizing

ghost commented 4 years ago

Ok solved it basically yesterday the problem i was having was due to the fact that some of my images were greyscale images i solved it by converting all of them to RGB... thanks for your time