fp16 engine works fine with trtexec but encountering nan with python API
@zerollzeng is already working on this.
Since Feb 13, 2024.
- Dominant language
- C++
- Stars
- 13.4k
- Forks
- 2.4k
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 2
Description
Description
I try to create a tensorrt engine from an onnx model
trtexec --onnx=model.onnx --saveEngine=engine.trt --fp16
When i use trtexec for inference it works fine
trtexec --loadEngine=engine.trt --fp16 --exportOutput=f
p16e.json
I can see that the output is just fine
fp16e.json.
But when I try to run this engine file with python API the output is nan.
Environment
TensorRT Version: 8.6
NVIDIA GPU: RTX 3070
NVIDIA Driver Version: 535.154.05
CUDA Version: 12.2
CUDNN Version: 8.9
Operating System:
Python Version (if applicable): 3.10
Tensorflow Version (if applicable):
PyTorch Version (if applicable):
Baremetal or Container (if so, version):
Relevant Files
Model link:
Steps To Reproduce
Commands or scripts:
Here is the python script I am using tensorrt_test_fps.py.txt
Have you tried the latest release?: yes
Can this model run on other frameworks? For example run ONNX model with ONNXRuntime (polygraphy run <model.onnx> --onnxrt):
Yes it runs fine when using CUDAExecutionProvider with ONNXRuntime but with TensorrtExecutionProvider I get the same issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.