Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python 3.7 numpy load ValueError: cannot reshape array of size 5218288 into shape (1974,3,128,128,3)

Tags:

python

numpy

Traceback (most recent call last):
  File "3dagn.py", line 468, in <module>
    hybrid_network()
  File "3dagn.py", line 107, in hybrid_network
    appx = np.load('file.npy')
  File "/home/dmjeong/anaconda3/envs/fer/lib/python3.7/site-packages/numpy/lib/npyio.py", line 440, in load
    pickle_kwargs=pickle_kwargs)
  File "/home/dmjeong/anaconda3/envs/fer/lib/python3.7/site-packages/numpy/lib/format.py", line 734, in read_array
    array.shape = shape
ValueError: cannot reshape array of size 5218288 into shape (1974,3,128,128,3)

Hi, I just wanna load npy file as usual. but this error occur for the first time.... I have no idea about this error here's the code

appx = np.load('mmi_app_x.npy')

other npy files are opened with that code without any error. i don't know 5218288 meaning. do you have any idea?

like image 225
dmjeong Avatar asked Jun 09 '26 08:06

dmjeong


1 Answers

It probably would be because of a damaged numpy file. In my case the file wasn't transferred correctly between servers. Re-transferring it solved the issue.

like image 116
ankit shukla Avatar answered Jun 10 '26 20:06

ankit shukla



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!