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

Replace use of sizeof() in file import/export code with explicit byte count #78

Open
imaami opened this issue Jul 13, 2017 · 3 comments

Comments

@imaami
Copy link

imaami commented Jul 13, 2017

Currently the binary layout of the weights files (and possibly other files) is defined using sizeof(int) and sizeof(size_t) which aren't guaranteed to be specific numbers across platforms. While sizeof(int) is most likely 4 bytes on any machine that Darknet is built for today, sizeof(size_t) can be either 4 or 8 bytes simply depending on whether the compiler is invoked with -m32 or -m64.

A binary file format should definitely be predictable, but unfortunately anyone who downloads the pre-trained weights files and attempts to run Darknet on a machine with a different build config than the author's will likely experience unexplainable behavior.

@adroit91
Copy link

I guess a pull request is in order.

@imaami
Copy link
Author

imaami commented Aug 14, 2017

@adroit91 You're right. I apologize that I haven't written a patch yet. I'll try to do that soon (and I hope @pjreddie starts merging my pull requests, there are several waiting already...)

@zinkcious
Copy link

Did @pjreddie accept your pull requests? @imaami

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

3 participants