Description
I trained a model using tensorflow (v2) detection API.
Then I exported to ONNX.
I then tried to convert it to tensorrt on NVIDIA Jetson.
This failed due to tensorrt not recognising NonMaximumSuppresion.
Finally I installed tensorrt v8.0.1.6, tensorrt OSS and the latest onnx-tensorrt on a separate machine.
After successfully building, I tried converting the model to TRT.
Since then it consistently gives this error.
Input filename: /content/nvidia/face-model2-float-onnxsim.onnx
ONNX IR version: 0.0.7
Opset version: 11
Producer name:
Producer version:
Domain:
Model version: 0
Doc string:
WARNING: ONNX model has a newer ir_version (0.0.7) than this parser was built against (0.0.6).
[2021-07-26 14:57:16 INFO] [MemUsageChange] Init CUDA: CPU +0, GPU +0, now: CPU 0, GPU 254 (MiB)
Parsing model
[2021-07-26 14:57:16 WARNING] /content/nvidia/onnx-tensorrt/onnx2trt_utils.cpp:364: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32.
[2021-07-26 14:57:16 WARNING] /content/nvidia/onnx-tensorrt/onnx2trt_utils.cpp:390: One or more weights outside the range of INT32 was clamped
While parsing node number 255 [TopK → “StatefulPartitionedCall/Postprocessor/BatchMultiClassNonMaxSuppression/MultiClassNonMaxSuppression/SortByField/TopKV2:0”]:
— Begin node —
input: “StatefulPartitionedCall/Postprocessor/BatchMultiClassNonMaxSuppression/MultiClassNonMaxSuppression/Select:0”
input: “Unsqueeze__600:0”
output: “StatefulPartitionedCall/Postprocessor/BatchMultiClassNonMaxSuppression/MultiClassNonMaxSuppression/SortByField/TopKV2:0”
output: “StatefulPartitionedCall/Postprocessor/BatchMultiClassNonMaxSuppression/MultiClassNonMaxSuppression/SortByField/TopKV2:1”
name: “StatefulPartitionedCall/Postprocessor/BatchMultiClassNonMaxSuppression/MultiClassNonMaxSuppression/SortByField/TopKV2”
op_type: “TopK”
attribute {
name: “sorted”
i: 1
type: INT
}
— End node —
ERROR: /content/nvidia/onnx-tensorrt/builtin_op_importers.cpp:4293 In function importTopK:
[8] Assertion failed: (inputs.at(1).is_weights()) && “This version of TensorRT only supports input K as an initializer.”
I have used onnx-simplifier yet it the error persists. I have also used polygraphy surgeon all to no avail.
Environment
TensorRT Version: * TensorRT 8.0.1.6
GPU Type:
Nvidia Driver Version: Driver Version: 460.32.03
CUDA Version: 11.2
CUDNN Version: CUDNN_MAJOR 7
Operating System + Version: Ubuntu 18.04.5 LTS
Python Version (if applicable): 3.7.11
TensorFlow Version (if applicable): 2.5.0
PyTorch Version (if applicable):
Baremetal or Container (if container which image + tag):
Relevant Files
Attached is the notebook I used for the experiments, also contained are the converted models.
https://drive.google.com/drive/folders/1mqETw7Ltjcwf8wgAsV3n6SP9Kx0v3xg6?usp=sharing
Steps To Reproduce
Please include:
- Exact steps/commands to build your repro
- Exact steps/commands to run your repro
- Full traceback of errors encountered
Your help will be most appreciated.