ValueError: cannot reshape array of size 226560000 into shape (1,15000,59,1)
时间: 2024-05-19 12:13:18 浏览: 104
python3.7解决最小二乘遇到ValueError:Expected 2D array, got 1D array instead: array=[5.].关于reshape和predict
This error occurs because the total number of elements in the array is 226560000, which is incompatible with the desired shape of (1,15000,59,1).
To resolve this issue, you can either change the shape of the array or adjust the desired shape to match the current size of the array.
Here are some possible solutions:
1. Check the shape of the original array and make sure it has the correct dimensions before attempting to reshape it.
2. If the array has a larger size than expected, you can try reducing the number of elements by selecting a subset of the data or by using a different data representation.
3. If the desired shape is incorrect, you can adjust it to match the size of the array. For example, you could reshape the array to (150, 100, 59, 1) or (300, 500, 1, 59) depending on your specific needs.
4. If the array is too large to fit into memory, you can consider using a memory-mapped array or processing the data in smaller batches.
阅读全文