-
Notifications
You must be signed in to change notification settings - Fork 631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to convert Yolov4x-mish/csp model into onnx &do inferencing? #253
Comments
You may use OnnxRuntime for onnx mode inferencing. https://github.com/microsoft/onnxruntime. It provides various execution providers such as CPU, CUDA and TensorRT. |
@stevenlix i was able to do inference using this script, but how should i draw bbox & visualize results? import onnxruntime model = onnxruntime.InferenceSession(r"K:\company_work\MODEL_WEIGHTS\trt_onnx\yolov4x-mish-custom-electronics-416x416.onnx",None) #def onnx_inf(model,img): reference: |
using this scipt i was able to solve inferense , this is yolov4.onxx which is provided by repo But when im trying to do same with my custom data im not able to get proper output shapes i tried this repo for converting yolo models to onnx & tensorrt |
the error message indicates your input shape doesn't match model's input. Please check your input data on 000_net |
This comment has been minimized.
This comment has been minimized.
@stevenlix i solved this problem using np.rollaxis , my model is reciving NHWC as input,so i converted it into NCHW ,but again im getting this issue in postprocessing. i solved this issue by conv_raw_dxdy = pred[:, :, :, :, 0:2] to this commenting one conv_raw_dxdy = pred[:, :, :, 0:2] again im getting this issue |
@akashAD98 Could you provide the full python script you're working with? Otherwise, what are the output tensor shapes when you inference your custom model with onnxruntime?
|
@jkjung-avt im using this scipt for onnx inference
#def onnx_inf(model,img): #print(len(output)) --->
|
What are the "shapes" of the output tensors? Are they (1, 52, 52, 3, 8), (1, 26, 26, 3, 8) and (1, 13, 13, 3, 8)? |
It looks like the You need to either rewrite/modify the postprocessing code or shuffle the outputs (converting channel_first to channel last)... |
so i changed NHWC to NCHW using then i got output shape which i have mentioned here #253 (comment) now i ran last script & got this issue now im confused ,where & which line should i need to do conversion of Channnel first to channel last ? in |
def postprocess_boxes(pred_bbox, org_img_shape, input_size, score_threshold):
|
@akashAD98 This post might be helpful to you: jkjung-avt/tensorrt_demos#510 (comment) |
I followed this tutorial https://github.com/linghu8812/tensorrt_inference
I was able to do the conversion, but how can i do inferencing or testing of this converted yolov4x-mish.onnx model?
The text was updated successfully, but these errors were encountered: