问题遇到的现象和发生背景
就简简单单一句加载npy文件代码,不知道为啥报错了reshape?
问题相关代码,请勿粘贴截图
import os
from osgeo import gdal
from osgeo import ogr
import sys
import random
import numpy as np
import pandas as pd
x_train_array = np.load('../x_1_25_final_array_new.npy')
运行结果及报错内容
Traceback (most recent call last):
File "/home/wangweiming/下载/FirePredict1031/me/test.py", line 10, in <module>
x_train_array = np.load('../x_1_25_final_array_new.npy')
File "/home/wangweiming/anaconda3/lib/python3.8/site-packages/numpy/lib/npyio.py", line 440, in load
return format.read_array(fid, allow_pickle=allow_pickle,
File "/home/wangweiming/anaconda3/lib/python3.8/site-packages/numpy/lib/format.py", line 783, in read_array
array.shape = shape
ValueError: cannot reshape array of size 19429344 into shape (53018,1,17,25,25)
我的解答思路和尝试过的方法
我并没有使用reshape语句,检查了源文件,我也没有修改过文件或查到reshape语句
我想要达到的结果
要怎么解决或避开这问题成功加载npy文件