首页 > 解决方案 > Nested ndarray reshape

问题描述

I have a problem,i am working with tensorflow keras for classification. For this i loaded images with skimage.io and store it into pandas dataframe. Now the problem is that i have ndarrays of shape(160,160) within ndarray of shape (520,). Now, i want to convert this to shape(520,160,160).I tried reshape method

array = np.array(df.image)
array.reshape(520,160,160)

This code give me error: ValueError: cannot reshape array of size 520 into shape (520,160,160)

标签: pythonnumpytensorflow

解决方案


推荐阅读