openvinotoolkit / openvino

OpenVINO™ is an open-source toolkit for optimizing and deploying AI inference
https://docs.openvino.ai
Apache License 2.0
7.24k stars 2.26k forks source link

[Bug]: Operators unsupported #24609

Closed JoewVm closed 4 months ago

JoewVm commented 5 months ago

OpenVINO Version

OpenVINO 2024.1.0

Operating System

Windows System

Device used for inference

CPU

Framework

PyTorch

Model used

No response

Issue description

Operators unsupported issue when using OpenVINO to convert pytorch model to openvino model. 当使用OpenVINO将pytorch模型转换为openvino模型时出现算子不支持的问题。 image

Step-by-step reproduction

No response

Relevant log output

Traceback (most recent call last):
  File "d:\dachuang\BYHE-master-mod3\transformer.py", line 41, in <module>
    ov_model = ov.convert_model(
  File "D:\anaconda3\envs\rppg\lib\site-packages\openvino\tools\ovc\convert.py", line 100, in convert_model
    ov_model, _ = _convert(cli_parser, params, True)
  File "D:\anaconda3\envs\rppg\lib\site-packages\openvino\tools\ovc\convert_impl.py", line 547, in _convert
    raise e
  File "D:\anaconda3\envs\rppg\lib\site-packages\openvino\tools\ovc\convert_impl.py", line 489, in _convert
    ov_model = driver(argv, {"conversion_parameters": non_default_params})
  File "D:\anaconda3\envs\rppg\lib\site-packages\openvino\tools\ovc\convert_impl.py", line 240, in driver
    ov_model = moc_emit_ir(prepare_ir(argv), argv)
  File "D:\anaconda3\envs\rppg\lib\site-packages\openvino\tools\ovc\convert_impl.py", line 189, in prepare_ir
    ov_model = moc_pipeline(argv, moc_front_end)
  File "D:\anaconda3\envs\rppg\lib\site-packages\openvino\tools\ovc\moc_frontend\pipeline.py", line 244, in moc_pipeline
    ov_model = moc_front_end.convert(input_model)
  File "D:\anaconda3\envs\rppg\lib\site-packages\openvino\frontend\frontend.py", line 18, in convert
    converted_model = super().convert(model)
openvino._pyopenvino.OpConversionFailure: Check 'is_conversion_successful' failed at src\frontends\pytorch\src\frontend.cpp:143:
FrontEnd API failed with OpConversionFailure:
Model wasn't fully converted. Failed operations detailed log:
-- prim::Constant with a message:
Exception happened during conversion of operation prim::Constant with schema (no schema)
Unable to cast Python instance of type <class 'NoneType'> to C++ type '?' (#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for details)
-- prim::ListConstruct with a message:
Exception happened during conversion of operation prim::ListConstruct with schema (no schema)
Check '!input_shapes.empty()' failed at src\core\shape_inference\include\concat_shape_inference.hpp:17:
While validating node 'opset1::Concat Concat_758 () -> (dynamic[...])' with friendly_name 'Concat_758'

-- prim::ListUnpack with a message:
prim::ListUnpack: unsupported input node: opset1::Constant aten::size/ShapeOf () -> (i64[0])
-- prim::device with a message:
String constant cannot be converted to OpenVINO opset and should be removed by consuming operation.
Summary:
-- No conversion rule found for operations: aten::__contains__, aten::append, aten::split, prim::layout
-- Conversion is failed for: prim::Constant, prim::ListConstruct, prim::ListUnpack, prim::device

Issue submission checklist

mlukasze commented 5 months ago

@mvafin could we create GFIs based on this request?

andrei-kochin commented 5 months ago

@JoewVm thank you for reaching the OpenVINO! Could you please share the model with us as obviously according to the error some layers are not supported but there might be some model issues as well

andrei-kochin commented 5 months ago

@JoewVm any updates for us?

JoewVm commented 5 months ago

@JoewVm any updates for us?

Do you mean you need the complete program file for the model?

mvafin commented 5 months ago

@JoewVm Did you provide example_input argument to convert_model? Those operations look like they are generated by scripting, which happens when example_input is not provided.

andrei-kochin commented 4 months ago

@JoewVm any updates on the question from Maxim?

JoewVm commented 4 months ago

There was no error after adding example_input, sorry for not replying until now!

@JoewVm Did you provide example_input argument to convert_model? Those operations look like they are generated by scripting, which happens when example_input is not provided.

avitial commented 4 months ago

Closing this as it seems issue has been addressed. Feel free to reopen and ask additional questions related to this topic.