I am trying to convert an ONNX model to an OpenVino IR model. However, the ONNX model contains an unsupported op 'ScatterND'. Since ScatterND is quite similar to Scatter_Add, I was seeing if I could find the implementation for the Scatter_Add extension (the file with the execute() function). I can't seem to find it. Is it proprietary?
Also, I can't seem to understand what to do after I've written the custom implementation code. I've already added the op to the Model Optimizer extensions but I don't know how to proceed with building the Inference Engine implementation. Where do I place the file, and how do I build it?
I suggest you try using ScatterND extension implementation that is available in GitHub, at the following link:
For Inference Engine implementation, please refer to the following links for the necessary steps:
- Common Workflow for Using the Inference Engine API
- Integrate the Inference Engine with Your Application
Hi @Munesh_Intel . Thank you so much for replying. I tried using the scatternd.py extension already present.
Since I needed the ScatterND function, I just inherited the ScatterND base class and used its infer function:
class ScatterND(ScatterNDBase): op = op_type = "ScatterND" version = None @staticmethod def infer(node: Node): ScatterNDBase.infer(node)
but it still gives the error:
[ ERROR ] Cannot infer shapes or values for node "ScatterND_748". [ ERROR ] There is no registered "infer" function for node "ScatterND_748" with op = "ScatterND". Please implement this function in the extensions. For more information please refer to Model Optimizer FAQ (https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_Model_Optimizer_FAQ.html), question #37. [ ERROR ] [ ERROR ] It can happen due to bug in custom shape infer function <UNKNOWN>. [ ERROR ] Or because the node inputs have incorrect values/shapes. [ ERROR ] Or because input shapes are incorrect (embedded to the model or passed via --input_shape). [ ERROR ] Run Model Optimizer with --log_level=DEBUG for more information. [ ERROR ] Exception occurred during running replacer "REPLACEMENT_ID" (<class 'extensions.middle.PartialInfer.PartialInfer'>): Stopped shape/value propagation at "ScatterND_748" node. For more information please refer to Model Optimizer FAQ (https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_Model_Optimizer_FAQ.html), question #38.
I don't get what the issue is. The infer function seems to be defined.
Could you help me with this? I've attached the scatternd.py (in txt form because .py are not allowed) and the debug log.
Please try the complete fix from this Github pull request https://github.com/openvinotoolkit/openvino/pull/584
As I see this PR was already merged into the master branch. As for Intel Distribution of OpenVINO toolkit, it is going to be included into next public release.
Hope this helps.
Best regards, Max.
Hi @Max_L_Intel. Thanks for Replying!
I think I do have the changes made by that PR since I have the scatternd.py. However, it seems that the op it introduces has been registered by the name of ScatterNDUpdate. I still can't find ScatterND as a registered op, or the model would have been optimized successfully. Can you please help me with this?
Would you like me to send you the ONNX model?
Thanks a lot!