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

[JAVA] If_0_then_branch__Inline_0__/decoder/rnn/LSTM' Status Message: Input X must have 3 dimensions only. Actual:{1,1,1,128,4} #550

Open
Furtherking opened this issue Oct 11, 2024 · 5 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@Furtherking
Copy link

❓ Questions and Help

Error code - ORT_INVALID_ARGUMENT - message: Non-zero status code returned while running If node. Name:'If_0' Status Message: Non-zero status code returned while running If node. Name:'If_0_then_branch__Inline_0__/decoder/If_1' Status Message: Non-zero status code returned while running LSTM node. Name:'If_0_then_branch__Inline_0__/decoder/rnn/LSTM' Status Message: Input X must have 3 dimensions only. Actual:{1,1,1,128,4}

The error occurred when using the code in example/java.I have already modified part of the code in the SlieroVadOnnxModel by referring to wavjava to make the input compatible with V5, but I still encountered this error. Has anyone else encountered this issue, and what should I do?

@Furtherking Furtherking added the help wanted Extra attention is needed label Oct 11, 2024
@snakers4 snakers4 changed the title ❓ Questions / Help / Support [JAVA] If_0_then_branch__Inline_0__/decoder/rnn/LSTM' Status Message: Input X must have 3 dimensions only. Actual:{1,1,1,128,4} Oct 11, 2024
@snakers4
Copy link
Owner

snakers4 commented Oct 11, 2024

A possible step-by-step solution:

  • Launch old JAVA example;
  • Print tensor dimensions on each step of the ONNX wrapper;
  • Launch v5 python ONNX example and print the same dimensions;
  • Amend the new JAVA example accordingly;

From the error it may seem that an extra dimension was passed at some point somewhere.

Also comparing the probabilities is useful. Also the current JAVA example was not updated for v5.

@Furtherking
Copy link
Author

Furtherking commented Oct 11, 2024 via email

@Furtherking
Copy link
Author

I tried it out, but strangely, despite my current code having the same input dimensions as the python/javawav example and maintaining consistent dimensions, the javawav runs normally, while the javaexample for reading microphone audio encounters errors. Could there be a problem with the original part that reads the microphone audio?

@snakers4
Copy link
Owner

All other factors being equal if python and java output similar probabilities for each chunk in ideal case, then it is data preprocessing most likely

In this case look for the data format differences (sample rate, channels, dimensions, chunk size)

@Furtherking
Copy link
Author

I have resolved the bug in the model.call() method by modifying the multiplication symbol (*) to a division symbol (/) in the array initialization: byte[] data = new byte[WINDOW_SIZE_SAMPLES / 2];.
But there still some problems,It seems that the change in input has led to the audio input captured from the microphone no longer providing accurate results. The SpeechProb values are consistently very low, even reaching levels as low as 0.0001, which makes it impossible to determine whether there is speech activity based on SpeechProb. Is this due to modifications in the v5 model?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants