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
ND4J: Error in Nd4j.toNpyByteArray(INDArray) format? #7466
Comments
We need source code. |
This is the code on the Android side
On the server side, this is what is used
Numpy version is 1.16.2 I will try the snapshot with Thanks |
Note that the |
It looks as if I'll keep you posted if I progress more |
I ran into this issue too. Here is some extra info:
Hex dump of files produced by Nd4j:
Hex dump of a different file (3x3 identity matrix) saved in Numpy (not from Java):
Looks like the header is added twice in Nd4j. |
Yes, that is what I saw. Also it seems that is affecting the padding of blanks. |
OK, some progress, but not a solution yet: https://github.com/deeplearning4j/deeplearning4j/pull/7518/files Header was definitely incorrectly added in BaseNativeNDArrayFactory.java (see removed magicPointer in PR). However, that still leaves us with a difference between numpy-generated and ND4J-generated arrays: Header and content is ultimately coming from here: deeplearning4j/libnd4j/include/cnpy/cnpy.cpp Lines 582 to 603 in e5125b5
And, the wrong type ("<?4" instead of "<f4") from here:
cnpy.cpp is a 3rd party library. Might be old, outdated, or simply wrong? |
Fixed. Thanks for highlighting this problem. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Reported in Gitter:
The text was updated successfully, but these errors were encountered: