rogersce / cnpy

library to read/write .npy and .npz files in C/C++
MIT License
1.34k stars 301 forks source link

cannot create std::vector larger than max_size() #73

Open xanderdunn opened 3 years ago

xanderdunn commented 3 years ago

Running this line:

cnpy::NpyArray arr = cnpy::npy_load("X.npy");

produces this error:

terminate called after throwing an instance of 'std::length_error'
  what():  cannot create std::vector larger than max_size()
./cpp_model.sh: line 20: 15311 Aborted                 (core dumped)

with X.npy.zip. The array is pretty small, with shape (137, 24, 144). This is well under the int limit in #71. Loading it in Python via import numpy as np; np.load("./X.npy") works as expected. The array is all doubles.