NVIDIA / NVIDIA/TensorRT

Abnormal of onnx model to trt model in the inference results

Open
#4,125 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Module:ONNX triaged
Dominant language
C++
Stars
13.4k
Forks
2.4k
Avg merge
5d 3h
Merged PRs (30d)
2

Description

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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, entry points, model artifacts, or reproducible commands are provided. Start by reviewing the reported PyTorch autocast and ONNX-to-TensorRT conversion comparison; done would require identifying the cause of the differing inference results and documenting a reproducible diagnosis.

Written by the indexing model from the issue text.

Assessment

Tech stack
pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.