# Error converting ONNX model to TensorRT

**URL:** <https://forums.developer.nvidia.com/t/error-converting-onnx-model-to-tensorrt/314941>\
**Category:** TensorRT\
**Tags:** tensorrt\
**Created:** [November 27, 2024, 12:04pm UTC](https://forums.developer.nvidia.com/t/error-converting-onnx-model-to-tensorrt/314941 "2024-11-27T12:04:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mateus.marques](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@mateus.marques](https://forums.developer.nvidia.com/u/mateus.marques)\
**Post date:** [November 27, 2024, 12:04pm UTC](https://forums.developer.nvidia.com/t/error-converting-onnx-model-to-tensorrt/314941/1 "2024-11-27T12:04:57Z")

</div>

Hello everyone,

I am facing a problem when trying to convert a trained YOLO model (`best.pt`) to TensorRT format (`best.trt`).

Steps taken:

- pytorch to onnx conversion
  - The conversion to ONNX seems to work without problems, generating the best.onnx file.

- I then tried to convert the ONNX file to TensorRT using Python scripting

Problem:

- The process seems to crash when calling `builder.build_engine(network, config)`, and the script keeps running for hours without progress.

Additional information:

\*GPU: NVIDIA L40S with 48GB VRAM.

- Driver: 566.03
- CUDA: 12.7
- TensorRT: 10.6.0
- Operating system: Windows 11
- Environment: Python 3.10.15

here are the image of the process

 ![imagem_2024-11-27_090430543](https://global.discourse-cdn.com/nvidia/original/4X/4/d/a/4da73e689ceccc7f7b2260ace8da3a5b793a2db2.png)

---

<div class="post-metadata">

**Author:** ![AakankshaS](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aakankshas/32/14047_2.png) [@AakankshaS](https://forums.developer.nvidia.com/u/AakankshaS)\
**Post date:** [November 30, 2024, 8:13am UTC](https://forums.developer.nvidia.com/t/error-converting-onnx-model-to-tensorrt/314941/2 "2024-11-30T08:13:29Z")

</div>

Hi @mateus.marques ,  
Did you check if the standalone onnx works fine?  
Can you pls try onnx checker and confirm?  
If everything works fine, pls share with us the onnx model and repro script

Thanks
