I’m working on a project which depends on Deep learning pose-estimation model from TensorFlow’s MoveNet.
We are working with a Jetson Xavier NX Developer kit.
We would like to run the model using TensorRT and for this purpose we tried the following conversion steps:
tflite -> ONNX32 -> ONNX16 -> TensorRT
Conversion from tflite to ONNX was done through PINTO model’s zoo conversion script, here. To convert the model from FP32 to FP16 I used I used the pip package onnxmltools
.
Subsequently I ran the trtexec command on the Jetson to convert the ONNX model to TensorRT
/usr/src/tensorrt/bin/trtexec --onnx=model_float16.onnx --saveEngine=model_fp16.trt
However the conversion tool is returning an error, and it seems to be a problem when trying to cast down from INT64 to INT32. The error message refers to a particular node Resize__242 and I provide screenshots of the node information I obtained using a model visualization tool:
Input filename: model_float16.onnx
ONNX IR version: 0.0.6
Opset version: 11
Producer name: tf2onnx
Producer version: 1.9.3
Domain:
Model version: 0
Doc string:
----------------------------------------------------------------
[2022-05-29 15:02:49 INFO] [MemUsageChange] Init CUDA: CPU +473, GPU +0, now: CPU 489, GPU 1196 (MiB)
[2022-05-29 15:02:50 INFO] [MemUsageSnapshot] Begin constructing builder kernel library: CPU 489 MiB, GPU 1196 MiB
[2022-05-29 15:02:50 INFO] [MemUsageSnapshot] End constructing builder kernel library: CPU 643 MiB, GPU 1238 MiB
Parsing model
[2022-05-29 15:02:50 WARNING] onnx2trt_utils.cpp:370: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32.
[2022-05-29 15:02:50 ERROR] (Unnamed Layer* 111) [Constant]:constant weights has count 0 but 1 was expected
While parsing node number 207 [Cast -> "Resize__242_input_cast_1"]:
--- Begin node ---
input: "roi__271"
output: "Resize__242_input_cast_1"
name: "Resize__242_input_cast1"
op_type: "Cast"
attribute {
name: "to"
i: 1
type: INT
}
--- End node ---
ERROR: ModelImporter.cpp:179 In function parseGraph:
[6] Invalid Node - Resize__242_input_cast1
(Unnamed Layer* 111) [Constant]:constant weights has count 0 but 1 was expected
Resize__242 Node
Is there a problem with my ONNX_FP16 model which causes the error? Is this particular operation not supported by TensorRT? Any tips or help will be greatly appreciated!