Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npy file size limit #98

Open
erichnau opened this issue Feb 14, 2024 · 2 comments
Open

npy file size limit #98

erichnau opened this issue Feb 14, 2024 · 2 comments

Comments

@erichnau
Copy link

I am sucessfully using cnpy for the conversion of a custom .fld format to .npy, however, i have lately observed issues with very large files. my npy files are written to a maximum size of 6.81GB - then writing stops but the process continues without any errors. the resulting npy is faulty because the array size specified in the header does not match the data.

@juelinl
Copy link

juelinl commented Apr 13, 2024

Hi, you can try to change lines 85 and 133 in the "cnpy.cpp" file to:

shape.push_back(std::stoul(sm[0].str()));

The original implementation uses std::stoi which cannot support shape dimension > 2,147,483,647.

pkestene added a commit to pkestene/cnpy-cmake that referenced this issue Apr 25, 2024
@erichnau
Copy link
Author

Great. Thanks guys, that solved my issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants