I'm currently reading an image with deepLearning4j and trying to pass it to ONNX is giving me problems.
INDArray ndArray = loader.asMatrix(mat3).permute(0,2,3,1);
OnnxTensor tensor = OnnxTensor.createTensor(env, ndArray.data().asNioFloat(), ndArray.shape());
The problems is that they are not the same. The INDArray is like this:
[[[[ 103.0000 41.0000 155.0000]
[ 103.0000 42.0000 154.0000]
[ 102.0000 44.0000 153.0000]
[ 101.0000 45.0000 152.0000]
[ 101.0000 45.0000 152.0000]
.....
And the ONNX tensor is like this:
[103.0, 103.0, 102.0]
[101.0, 101.0, 101.0]
[101.0, 101.0, 101.0]
[101.0, 101.0, 101.0]
[101.0, 101.0, 101.0]
The overall shape I think is not the problem, that is how is printed but the columns of the NDArray are rows in ONNX