In [72]: alist = [np.ones((3,3,3)), np.zeros((3,3))]
In [73]: np.array(alist)
C:\Users\paul\AppData\Local\Temp\ipykernel_7196\2629805649.py:1: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
np.array(alist)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Input In [73], in <cell line: 1>()
----> 1 np.array(alist)
ValueError: could not broadcast input array from shape (3,3,3) into shape (3,3)
2条答案
按热度按时间dldeef671#
使用了
您的图像需要3个通道:(宽度、高度、颜色通道)
ilmyapht2#
显示类似错误的小示例