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

Nd4j example crash (hstack) #8218

Closed
RobAltena opened this issue Sep 9, 2019 · 1 comment · Fixed by SkymindIO/deeplearning4j#248
Closed

Nd4j example crash (hstack) #8218

RobAltena opened this issue Sep 9, 2019 · 1 comment · Fixed by SkymindIO/deeplearning4j#248
Assignees
Labels

Comments

@RobAltena
Copy link
Contributor

@RobAltena RobAltena commented Sep 9, 2019

Issue Description

@Test
void testSampleCrash() {
    INDArray rowVector1 = Nd4j.create(new double[]{1,2,3});
    INDArray rowVector2 = Nd4j.create(new double[]{4,5,6});

    INDArray vStack = Nd4j.vstack(rowVector1, rowVector2);      //Vertical stack:   [1,3]+[1,3] to [2,3]
    INDArray hStack = Nd4j.hstack(rowVector1, rowVector2);      //Horizontal stack: [1,3]+[1,3] to [1,6]
    System.out.println("\n\n\nCreating INDArrays from other INDArrays, using hstack and vstack:");
    System.out.println("vStack:\n" + vStack);
    System.out.println("hStack:\n" + hStack);
}

crashes with:

Error at [D:/jenkins/ws/dl4j-master-windows-x86_64-cpu/libnd4j/include/ops/declarable/generic/transforms/concat.cpp:147:0]:
CONCAT op: input axis must be in range [0, 0], but got 1 instead!

org.nd4j.linalg.exception.ND4JIllegalStateException: Op name concat failed to execute. You can't execute non-inplace CustomOp without outputs being specified

at 
org.nd4j.linalg.cpu.nativecpu.ops.NativeOpExecutioner.exec(NativeOpExecutioner.java:1679)
at org.nd4j.linalg.factory.Nd4j.exec(Nd4j.java:6606)
at org.nd4j.linalg.cpu.nativecpu.CpuNDArrayFactory.concat(CpuNDArrayFactory.java:557)
at org.nd4j.linalg.factory.Nd4j.concat(Nd4j.java:4917)

Process finished with exit code -1

Version Information

Beta5 examples ab_beta5 branch.
same result on SkymindIO sunday build. of nd4j.

  • Platform information (OS, etc)
    Win10.
@AlexDBlack

This comment has been minimized.

Copy link
Contributor

@AlexDBlack AlexDBlack commented Sep 9, 2019

Nd4j.create(new double[]{1,2,3}) that's a [3] array, not a [1,3] as it used to be in earlier versions of ND4J.
I think hstack for the 1d case should produce [6], so yeah, a bug for the 1D case.

@AlexDBlack AlexDBlack added the ND4J label Sep 9, 2019
@AlexDBlack AlexDBlack self-assigned this Sep 9, 2019
AlexDBlack added a commit to SkymindIO/deeplearning4j that referenced this issue Sep 9, 2019
Signed-off-by: AlexDBlack <blacka101@gmail.com>
AlexDBlack added a commit to SkymindIO/deeplearning4j that referenced this issue Sep 9, 2019
* eclipse#8218 Fix Nd4j.hstack rank 1 case

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* eclipse#8209 SameDiff: don't allow empty arrays (with 0s in shape) for variables

Signed-off-by: AlexDBlack <blacka101@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.