Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • The model includes unsupported node by cvtool
    Run the following command.

    Code Block
    $ graph_surgery.py onnx -m (model name before modification) -o (model name after modification) -t CVFlow

    Please refer here for the list of supported node.

    You can check if the model includes unsupported node, by using onnx_print_graph_summary.py in cvtool.

    Code Block
    $ onnx_print_graph_summary.py -p (model name)

  • Input of the model has variable value

    image-20240416-002601.png

    Replace with fixed value by the following command.

    Code Block
    $ graph_surgery.py onnx -m (model name before modification) -o (model name after modification) -isrc "i:input|is:1,3,960,960" -t SetIOShapes

  • Input shape of the model is NHWC, and transposed to NCHW first

    cutInput.jpg

    Separate from the beginning of the model to “Tranpose” node.

    Code Block
    $ graph_surgery.py onnx -m (model name before modification) -o (model name after modification) -isrc "i:(output name of Transpose node)|is:1,3,224,224" -t CutGraph

  • Unsupported character ( : | ; , ‘ ) is included in OUT_LAYER
    Rename the node by the following command.

    Code Block
    $ graph_surgery.py onnx -m (model name before modification) -o (model name after modification) -t "RenameTensors(original_name=new_name)"

    If multiple nodes are specified, please separate those by ",".

    Code Block
    -t "RenameTensors(node::1=node1,node::2=node2)"

  • The model has nodes of rank > 4
    Conversion may not be possible due to SoC constraints.

    You can check if the model has such nodes, by using onnx_print_graph_summary.py. The following message will be output when the nodes are found.

    Code Block
    $ onnx_print_graph_summary.py -p (model name)
    
    INFO: 08/29/2024 03:22:40.725761 onnx_print_graph_summary.py:384 [PrintGraphSummary] Unsupported tensors with rank > 4 (3):
    INFO: 08/29/2024 03:22:40.725837 onnx_print_graph_summary.py:386 [PrintGraphSummary] -> 'output' [1 x 3 x 52 x 52 x 85]
    INFO: 08/29/2024 03:22:40.725909 onnx_print_graph_summary.py:386 [PrintGraphSummary] -> '1026' [1 x 3 x 26 x 26 x 85]
    INFO: 08/29/2024 03:22:40.725993 onnx_print_graph_summary.py:386 [PrintGraphSummary] -> '1046' [1 x 3 x 13 x 13 x 85]

    Please modify the model in one of the following ways.
    ・Modify the nodes before exporting to onnx.
    ・Separate the back of the node from the model.

    Code Block
    $ graph_surgery.py onnx -m (model name before modification) -o (model name after modification) -on (node name before the node of rank > 4) -t CutGraph


    ・Replace the node with that of rank <= 4.

    Code Block
    $ graph_surgery.py onnx -m (model name before modification) -o (model name after modification) -t ReplaceSubgraph

    ※If you wish to use “ReplaceSubgraph”, please contact us.

Note

Althogh the node of rank=4, conversion may not be possible when the number of elements in the first dimension of the node is not 1. Please take the same action as in case of rank > 4.