Quantcast
Channel: TAO Toolkit - NVIDIA Developer Forums
Viewing all articles
Browse latest Browse all 497

Exporting to ONNX

$
0
0

I use the below command to export a model to ONNX;

tao model faster_rcnn export --gpu_index $GPU_INDEX -m /workspace/tao-experiments/model.hdf5  \
                        -o $USER_EXPERIMENT_DIR/model.onnx \
                        -e $SPECS_DIR/specs.txt

At the end of the run, I get the following warnings:

WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_16/Merge of type Merge
      The generated ONNX model needs run with the custom op supports.
2024-03-01 13:24:57,984 [TAO Toolkit] [WARNING] keras2onnx 301: WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_16/Merge of type Merge
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_16/Switch_2 of type Switch
      The generated ONNX model needs run with the custom op supports.
2024-03-01 13:24:57,984 [TAO Toolkit] [WARNING] keras2onnx 301: WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_16/Switch_2 of type Switch
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_16/Switch_1 of type Switch
      The generated ONNX model needs run with the custom op supports.
2024-03-01 13:24:57,984 [TAO Toolkit] [WARNING] keras2onnx 301: WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_16/Switch_1 of type Switch
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_12/Merge of type Merge
      The generated ONNX model needs run with the custom op supports.
2024-03-01 13:24:57,984 [TAO Toolkit] [WARNING] keras2onnx 301: WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_12/Merge of type Merge
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_12/Switch_1 of type Switch
      The generated ONNX model needs run with the custom op supports.
2024-03-01 13:24:57,984 [TAO Toolkit] [WARNING] keras2onnx 301: WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_12/Switch_1 of type Switch
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_13/Merge of type Merge
      The generated ONNX model needs run with the custom op supports.
2024-03-01 13:24:57,984 [TAO Toolkit] [WARNING] keras2onnx 301: WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_13/Merge of type Merge
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_8/Merge of type Merge
      The generated ONNX model needs run with the custom op supports.
2024-03-01 13:24:57,984 [TAO Toolkit] [WARNING] keras2onnx 301: WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_8/Merge of type Merge
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_13/Switch_1 of type Switch
      The generated ONNX model needs run with the custom op supports.
2024-03-01 13:24:57,985 [TAO Toolkit] [WARNING] keras2onnx 301: WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_13/Switch_1 of type Switch
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_8/Switch_2 of type Switch
      The generated ONNX model needs run with the custom op supports.
2024-03-01 13:24:57,985 [TAO Toolkit] [WARNING] keras2onnx 301: WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_8/Switch_2 of type Switch
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_8/Switch_1 of type Switch
      The generated ONNX model needs run with the custom op supports.
2024-03-01 13:24:57,985 [TAO Toolkit] [WARNING] keras2onnx 301: WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_8/Switch_1 of type Switch
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_11/Merge of type Merge
      The generated ONNX model needs run with the custom op supports.
2024-03-01 13:24:57,985 [TAO Toolkit] [WARNING] keras2onnx 301: WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_11/Merge of type Merge
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_11/Switch_2 of type Switch
      The generated ONNX model needs run with the custom op supports.
2024-03-01 13:24:57,985 [TAO Toolkit] [WARNING] keras2onnx 301: WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_11/Switch_2 of type Switch
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_11/Switch_1 of type Switch
      The generated ONNX model needs run with the custom op supports.
2024-03-01 13:24:57,985 [TAO Toolkit] [WARNING] keras2onnx 301: WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_11/Switch_1 of type Switch
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_2/Merge of type Merge
      The generated ONNX model needs run with the custom op supports.
2024-03-01 13:24:57,985 [TAO Toolkit] [WARNING] keras2onnx 301: WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_2/Merge of type Merge
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_2/Switch_2 of type Switch
      The generated ONNX model needs run with the custom op supports.
2024-03-01 13:24:57,985 [TAO Toolkit] [WARNING] keras2onnx 301: WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_2/Switch_2 of type Switch
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_2/Switch_1 of type Switch
      The generated ONNX model needs run with the custom op supports.
2024-03-01 13:24:57,985 [TAO Toolkit] [WARNING] keras2onnx 301: WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_2/Switch_1 of type Switch
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_5/Merge of type Merge
      The generated ONNX model needs run with the custom op supports.
2024-03-01 13:24:57,985 [TAO Toolkit] [WARNING] keras2onnx 301: WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_5/Merge of type Merge
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_5/Switch_2 of type Switch
      The generated ONNX model needs run with the custom op supports.
2024-03-01 13:24:57,985 [TAO Toolkit] [WARNING] keras2onnx 301: WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_5/Switch_2 of type Switch
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_5/Switch_1 of type Switch
      The generated ONNX model needs run with the custom op supports.
2024-03-01 13:24:57,985 [TAO Toolkit] [WARNING] keras2onnx 301: WARN: No corresponding ONNX op matches the tf.op node proposal_1/cond_5/Switch_1 of type Switch
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node proposal_1/BroadcastTo_2 of type BroadcastTo
      The generated ONNX model needs run with the custom op supports.
2024-03-01 13:24:57,985 [TAO Toolkit] [WARNING] keras2onnx 301: WARN: No corresponding ONNX op matches the tf.op node proposal_1/BroadcastTo_2 of type BroadcastTo
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node proposal_1/BroadcastTo_1 of type BroadcastTo
      The generated ONNX model needs run with the custom op supports.
2024-03-01 13:24:57,985 [TAO Toolkit] [WARNING] keras2onnx 301: WARN: No corresponding ONNX op matches the tf.op node proposal_1/BroadcastTo_1 of type BroadcastTo
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node proposal_1/BroadcastTo of type BroadcastTo
      The generated ONNX model needs run with the custom op supports.
2024-03-01 13:24:57,985 [TAO Toolkit] [WARNING] keras2onnx 301: WARN: No corresponding ONNX op matches the tf.op node proposal_1/BroadcastTo of type BroadcastTo
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node crop_and_resize_1/CropAndResize of type CropAndResize
      The generated ONNX model needs run with the custom op supports.
2024-03-01 13:24:58,013 [TAO Toolkit] [WARNING] keras2onnx 301: WARN: No corresponding ONNX op matches the tf.op node crop_and_resize_1/CropAndResize of type CropAndResize
      The generated ONNX model needs run with the custom op supports.
The ONNX operator number change on the optimization: 808 -> 489
2024-03-01 13:25:15,709 [TAO Toolkit] [INFO] keras2onnx 347: The ONNX operator number change on the optimization: 808 -> 489
Execution status: PASS
2024-03-01 13:25:29,115 [TAO Toolkit] [INFO] nvidia_tao_cli.components.docker_handler.docker_handler 337: Stopping container.

When I load the model using onnxruntime, I get an error:

import onnxruntime as ort
sess = ort.InferenceSession('model.onnx')

Error:

InvalidGraph: [ONNXRuntimeError] : 10 : INVALID_GRAPH : Load model from ./model.onnx failed:This is an invalid model. In Node, ("proposal", ProposalDynamic, "", -1) : ("sigmoid_output": tensor(float),"convolution_output1": tensor(float),) -> ("proposal_out": tensor(float),) , Error No Op registered for ProposalDynamic with domain_version of 12

PS1: I also tried with additional arguments, still the same error:

                        --target_opset 12 \
                        --gen_ds_config

PS2: I tried importing the model with cuda as a provider, also still the same error:

sess = ort.InferenceSession('model.onnx', providers=["CUDAExecutionProvider"])

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 497

Trending Articles