tsutof / tiny_yolov2_onnx_cam

Tiny YOLO v2 Inference Application with NVIDIA TensorRT
45 stars 15 forks source link

does it support to use with yolov3_onnx? #3

Closed ximitiejiang closed 4 years ago

ximitiejiang commented 4 years ago

hello, thanks for your great work, i success to run the yolov2 model, and trying to change the yolov2_onnx to yolov3 but met some errors. I just download the yolov3.onnx from onnx/models[https://github.com/onnx/models/tree/master/vision/object_detection_segmentation/yolov3], and it raise error in parser.parse(model.read()) as blow: [TensorRT] ERROR: Parameter check failed at: ../builder/Network.cpp::addInput::671, condition: isValidDims(dims, hasImplicitBatchDimension())

could you suggest any possible reason?

thanks!

tsutof commented 4 years ago

@ximitiejiang Thank you for your contact. Unfortunately NVIDIA TensorRT is not perfect in importing from ONNX. The issue you saw may be caused by not supported ONNX layer for TensorRT. I recommend you to try the yolov3_onnx sample included in the TensorRT release.

ximitiejiang commented 4 years ago

yes it is ok now, seems onnx not support direct transfer from yolov2/3 to onnx(onnx 1.5 and above not support upsample layer..), but by using trt transfer document i success transfered the yolov3 to onnx. one more question, i did not see img normalize(img/255, or (img/255-mean)/std) for your project, is that not needed for yolov2 inference?

tsutof commented 4 years ago

@ximitiejiang It depends on model. The tiny yolo v2 ONNX model of the ONNX model zoo, has the Mul layer which multiply img by 1/255. So img/255 is not needed in my Python script.

ximitiejiang commented 4 years ago

got it, thank you!