Skip to content
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

Error while Loading YOLOv8 Model with EfficientNMS_TRT Plugin in TRITON #210

Open
whitewalker11 opened this issue Aug 30, 2023 · 2 comments

Comments

@whitewalker11
Copy link

whitewalker11 commented Aug 30, 2023

Issue Description:

I am encountering an error while trying to load a YOLOv8 model with the EfficientNMS_TRT plugin in TRITON. The specific error message I am receiving is:

vbnet

UNAVAILABLE: Internal: onnx runtime error 1: Load model from /models/yolov8_onnx/1/model.onnx failed: Fatal error: TRT:EfficientNMS_TRT(-1) is not a registered function/op

Steps to Reproduce:

Export YOLOv8 model with EfficientNMS_TRT plugin.
Attempt to load the exported model into TRITON.

Expected Behavior:

The YOLOv8 model with the EfficientNMS_TRT plugin should load into TRITON without any errors.

Actual Behavior:

Encountering the aforementioned error message when trying to load the model into TRITON.

Additional Information:

YOLOv8 model was exported with EfficientNMS_TRT plugin.
The error seems to be related to the EfficientNMS_TRT plugin not being registered.
TRITON version: 23.05-py3-sdk

YOLOv8 Model Export Code: 
        input_shape = [1, 3, 640, 640]
    device = 'cpu'
    weights = 'path_to_yolov8_weights.pt'
    topk = 100

    YOLOv8 = YOLO(weights)
    model = YOLOv8.model.fuse().eval()
    
    for m in model.modules():
        optim(m)
        m.to(device)
        
    model.to(device)
    fake_input = torch.randn(input_shape).to(device)
    
    model(fake_input)
        
    save_path = weights.replace('.pt', '.onnx')
    
    onnx_model = torch.onnx.export(
        model,
        fake_input,
        save_path,
        input_names=['images'],
        output_names=['num_dets', 'bboxes', 'scores', 'labels'])
    
    print(f'ONNX export success, saved as {save_path}')
TRITON Loading Code:
    platform: "onnxruntime_onnx"
max_batch_size: 0
input [
{
  name: "images"
  data_type: TYPE_FP32
  dims: [ 1,3,640,640 ]
}
]
output [
{
  name: "output0"
  data_type: TYPE_FP32
  dims: [-1, -1, -1]
}
]

Possible Solutions Attempted:

Verified that the EfficientNMS_TRT plugin is correctly included during model export.
Checked for any compatibility issues between the TRITON version and the ONNX Runtime version.

Request for Assistance:

I'm seeking guidance on how to properly load a YOLOv8 model with the EfficientNMS_TRT plugin in TRITON. Any insights, suggestions, or steps to resolve this issue would be greatly appreciated. Thank you!

@kthui
Copy link
Contributor

kthui commented Aug 30, 2023

@tanmayv25 @oandreeva-nv Do you have some insights into loading a YOLOv8 model with the EfficientNMS_TRT plugin in TRITON?

@tanmayv25 tanmayv25 transferred this issue from triton-inference-server/server Aug 30, 2023
@tanmayv25
Copy link
Contributor

@whitewalker11 Did you try specifying the custom op plugin as specified here?
https://github.com/triton-inference-server/server/blob/main/docs/user_guide/custom_operations.md#onnx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants