报错环境:
把图片数据存到列表中,然后转为array
data = np.array(data, dtype='float32')
报错信息:
TypeError: only size-1 arrays can be converted to Python scalars
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "train_cl3_tf.py", line 76, in <module>
data = np.array(data, dtype='float32')
ValueError: setting an array element with a sequence.
原因:
数据的shape不一致, 必须要所有图片resize成一样的shape