Skip to content

Abnormal of onnx model to trt model in the inference results #4125

@tricky61

Description

@tricky61

I have convert my onnx model to tensorrt, however the result is quit strange.
My model is trained in mix precision,when I add the following line, will convert to fp16 onnx model( with some layer weights fp32).
@torch.autocast(device_type="cuda", enabled=True)
when not add this line, will conver to fp32 onnx model.
but neither the fp16 onnx model nor the fp32 onnx model converted to trt model can get the right result.
for example when I convert fp32 onnx to trt model, with or without --fp32, the result is almost same, also same of fp16 onnx to trt model's result.
so, where is the problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Module:ONNXIssues relating to ONNX usage and importtriagedIssue has been triaged by maintainers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions