openvino icon indicating copy to clipboard operation
openvino copied to clipboard

[Bug]: 'min_val' and 'max_val' should have the same type as 'out_type' attribute.

Open jikechao opened this issue 1 year ago • 1 comments

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/RandomUniformLike.onnx

Issue description

For the type of DOUBLE/Float64 about operator RandomUniformLike, OV conversion contains a bug.

The model structure is shown below: image image

Notice that 11 represents onnx.TensorProto.DOUBLE in ONNX.

Step-by-step reproduction

import openvino as ov

onnx_model_path = 'RandomUniformLike.onnx'
ov_model = ov.convert_model(onnx_model_path)

Relevant log output

Traceback (most recent call last):
  File "test.py", line 6, 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: 
While validating ONNX node '<Node(RandomUniformLike): y>':
Check 'validate::out_et(out_et) && (out_et == min_et)' failed at src\core\src\op\random_uniform.cpp:50:
While validating node 'opset8::RandomUniform RandomUniform_5 (ShapeOf_2[0]:i64[1], Constant_4[0]:f32[], Constant_3[0]:f32[]) -> (dynamic[...])' with friendly_name 'RandomUniform_5':
'min_val' and 'max_val' should have the same type as 'out_type' attribute.

Issue submission checklist

  • [X] I'm reporting an issue. It's not a question.
  • [X] I checked the problem with the documentation, FAQ, open issues, Stack Overflow, etc., and have not found a solution.
  • [X] There is reproducer code and related data files such as images, videos, models, etc.

jikechao avatar Nov 20 '23 06:11 jikechao