YOLOv3 conversion to TRT


I’m trying to convert YOLOv3 model into TRT, but this particular error pops up: [8] Assertion failed: scales.is_weights() && “Resize scales must be an initializer!”. I tried the convertion with ONNX 9, 10 and 11. For 9 and 10 the same error pops up but for opset 11, it’s a little different: [8] Assertion failed: (mode != “nearest” || nearest_mode == “floor”) && “This version of TensorRT only supports floor nearest_mode!”. I found this previously posted here in the forums. Is this the same issue that I’m facing? If so, are there any workarounds for the conversion?


TensorRT Version: 7.1.3
GPU Type: NVIDIA Volta
Nvidia Driver Version:
CUDA Version: 10.2
CUDNN Version: 8
Operating System + Version: Ubuntu 18.04
Python Version (if applicable): 3.6.9
TensorFlow Version (if applicable): 2.3.1
PyTorch Version (if applicable): NA
Baremetal or Container (if container which image + tag): Baremetal

Relevant Files

verbose_logs.log (255.4 KB)
Link to ONNX model

Steps To Reproduce

Run the following command to reproduce the error:
trtexec --onnx=detector_opset10.onnx --saveEngine=detector_opset10.plan --fp16 --optShapes=1x3x416x416 --verbose

Request you to share the ONNX model and the script if not shared already so that we can assist you better.
Alongside you can try few things:

  1. validating your model with the below snippet


import sys
import onnx
filename = yourONNXmodel
model = onnx.load(filename)
2) Try running your model with trtexec command.
In case you are still facing issue, request you to share the trtexec “”–verbose"" log for further debugging