cannot reshape array of size 1 into shape (3,100,100)
时间: 2024-05-28 07:08:53 浏览: 103
mnist(linux环境下gunzip解压)
5星 · 资源好评率100%
This error occurs when you are trying to reshape an array of size 1 into a shape that is incompatible with its size. In this specific case, you are trying to reshape an array of size 1 into a shape of (3,100,100), which means that you are trying to create a 3-dimensional array with 100 rows and 100 columns in each dimension. However, since the original array has only one element, it cannot be reshaped into a larger array with this shape.
To solve this error, you need to make sure that the size of the original array matches the size of the new shape you are trying to reshape it into. Alternatively, you can create a new array with the desired shape and copy the elements from the original array into the new array, using functions such as numpy.reshape() or numpy.resize().
阅读全文