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

[Bug]: Trilu second input must be a scalar #21172

Closed
3 tasks done
jikechao opened this issue Nov 20, 2023 · 2 comments · Fixed by #22286
Closed
3 tasks done

[Bug]: Trilu second input must be a scalar #21172

jikechao opened this issue Nov 20, 2023 · 2 comments · Fixed by #22286
Assignees
Labels
bug Something isn't working category: ONNX FE OpenVINO ONNX FrontEnd
Milestone

Comments

@jikechao
Copy link

OpenVINO Version

openvino-nightly 2023.2.0.dev20231101

Operating System

Ubuntu 18.04 (LTS)

Device used for inference

CPU

Framework

ONNX

Model used

https://github.com/jikechao/onnx_models/blob/main/Trilu.onnx

Issue description

OpenVINO converts the ONNX model failed and threw "Trilu second input must be a scalar".

image

However, the given ONNX model is a valid model which can execute inference well.
Thus, we hope OpenVINO can also support it rather than crash!

Step-by-step reproduction

import openvino as ov
onnx_model_path = 'Trilu.onnx'
ov_model = ov.convert_model(onnx_model_path)

Relevant log output

Traceback (most recent call last):
  File "test.py", line 15, in <module>
    ov_model = ov.convert_model(onnx_model_path)
  File "C:\software\conda\envs\torch\lib\site-packages\openvino\tools\ovc\convert.py", line 101, in convert_model
    ov_model, _ = _convert(cli_parser, params, True)
  File "C:\software\conda\envs\torch\lib\site-packages\openvino\tools\ovc\convert_impl.py", line 524, in _convert
    raise e
  File "C:\software\conda\envs\torch\lib\site-packages\openvino\tools\ovc\convert_impl.py", line 476, in _convert
    ov_model = driver(argv, {"conversion_parameters": non_default_params})
  File "C:\software\conda\envs\torch\lib\site-packages\openvino\tools\ovc\convert_impl.py", line 226, in driver
    ov_model = moc_emit_ir(prepare_ir(argv), argv)
  File "C:\software\conda\envs\torch\lib\site-packages\openvino\tools\ovc\convert_impl.py", line 172, in prepare_ir
    ov_model = moc_pipeline(argv, moc_front_end)
  File "C:\software\conda\envs\torch\lib\site-packages\openvino\tools\ovc\moc_frontend\pipeline.py", line 247, in moc_pipeline
    ov_model = moc_front_end.convert(input_model)
  File "C:\software\conda\envs\torch\lib\site-packages\openvino\frontend\frontend.py", line 18, in convert
    converted_model = super().convert(model)
RuntimeError: Check 'error_message.empty()' failed at src\frontends\onnx\frontend\src\frontend.cpp:124:
Errors during ONNX translation: 
Check '(inputs[1].get_partial_shape().compatible({}))' failed at src\frontends\onnx\frontend\src\op\trilu.cpp:30:
While validating ONNX node '<Node(Trilu): y>':
Trilu second input must be a scalar

Issue submission checklist

  • I'm reporting an issue. It's not a question.
  • I checked the problem with the documentation, FAQ, open issues, Stack Overflow, etc., and have not found a solution.
  • There is reproducer code and related data files such as images, videos, models, etc.
@jikechao jikechao added bug Something isn't working support_request labels Nov 20, 2023
@rkazants
Copy link
Contributor

Hi @jikechao,

According to the Trilu specification (https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Trilu-14), the second input is 0D tensor (or scalar). I think it is a bug in either software creating such ONNX model (PyTorch export to onnx, for example) or ONNX specification. I am leaning the first one.

@gkrivor, anyway let us fix it in OV side because the fix should be easy.

Best regards,
Roman

@jikechao
Copy link
Author

@rkazants @gkrivor Thanks for your plan to fix the bug in the OV side. It can increase the robustness of OV.

@andrei-kochin andrei-kochin added the category: ONNX FE OpenVINO ONNX FrontEnd label Nov 20, 2023
github-merge-queue bot pushed a commit that referenced this issue Apr 3, 2024
### Details:
 - update `trilu.cpp`

### Tickets:
 - Closes #21172

---------

Co-authored-by: Georgy Krivoruchko <[email protected]>
@mlukasze mlukasze added this to the 2024.1 milestone Apr 3, 2024
bbielawx pushed a commit to bbielawx/openvino that referenced this issue Apr 12, 2024
…#22286)

### Details:
 - update `trilu.cpp`

### Tickets:
 - Closes openvinotoolkit#21172

---------

Co-authored-by: Georgy Krivoruchko <[email protected]>
alvoron pushed a commit to alvoron/openvino that referenced this issue Apr 29, 2024
…#22286)

### Details:
 - update `trilu.cpp`

### Tickets:
 - Closes openvinotoolkit#21172

---------

Co-authored-by: Georgy Krivoruchko <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working category: ONNX FE OpenVINO ONNX FrontEnd
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants