I have a python list than includes 90900 nparrays shaped (299, 299, 3). I tried to convert this list to numpy array
X_trains = np.asarray(X_train).reshape((len(X_train),299,299,3))
However, this gave me the error:
ValueError: could not broadcast input array from shape (299,299,3) into shape (299,299)
I suppose that the part of the code that cause the error is np.asarray, is there any way to fix that?
Full error code:
ValueErrorTraceback (most recent call last)
<ipython-input-34-2ba5db77f6b1> in <module>()
1
2
----> 3 X_trains = np.asarray(X_train)
/usr/local/lib/python3.4/dist-packages/numpy/core/numeric.py in asarray(a, dtype, order)
529
530 """
--> 531 return array(a, dtype, copy=False, order=order)
532
533
ValueError: could not broadcast input array from shape (299,299,3) into shape (299,299)