# Onnx with nms conversion problem

**URL:** <https://community.ultralytics.com/t/onnx-with-nms-conversion-problem/1466>\
**Category:** Support\
**Tags:** support\
**Created:** [September 16, 2025, 7:18am UTC](https://community.ultralytics.com/t/onnx-with-nms-conversion-problem/1466 "2025-09-16T07:18:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shree\_Dixit](https://sea1.discourse-cdn.com/flex001/user_avatar/community.ultralytics.com/shree_dixit/32/981_2.png) [@Shree\_Dixit](https://community.ultralytics.com/u/Shree_Dixit)\
**Post date:** [September 16, 2025, 7:18am UTC](https://community.ultralytics.com/t/onnx-with-nms-conversion-problem/1466/1 "2025-09-16T07:18:51Z")

</div>

im training yolo V8 model , then i get the best.pt file now i want to convert it into onnx by keeping nms=true the input and output i expect is this:-

📥 Model Inputs:  
Input[0] Name: images, Shape: [1, 3, 480, 640], Type: tensor(float)  
Input[1] Name: max\_output\_boxes\_per\_class, Shape: [1], Type: tensor(int64)  
Input[2] Name: iou\_threshold, Shape: [1], Type: tensor(float)  
Input[3] Name: score\_threshold, Shape: [1], Type: tensor(float)

📤 Model Outputs:  
Output[0] Name: valid, Shape: [‘Castvalid\_dim\_0’], Type: tensor(int64)  
Output[1] Name: rois, Shape: [‘Gatherrois\_dim\_0’, 4], Type: tensor(float)  
Output[2] Name: scores, Shape: [‘Gatherscores\_dim\_0’], Type: tensor(float)  
Output[3] Name: class\_ids, Shape: [‘Gatherclass\_ids\_dim\_0’], Type: tensor(int64)  
Output[4] Name: masks, Shape: [‘Reshapemasks\_dim\_0’, 120, 160], Type: tensor(float)

But instead i get this

📥 Model Inputs:  
Input[0] Name: images, Shape: [‘batch’, 3, ‘height’, ‘width’], Type: tensor(float)

📤 Model Outputs:  
Output[0] Name: output0, Shape: [‘batch’, ‘Concatoutput0\_dim\_1’, ‘anchors’], Type: tensor(float)

can anyone help me with this .

---

<div class="post-metadata">

**Author:** ![Toxite](https://sea1.discourse-cdn.com/flex001/user_avatar/community.ultralytics.com/toxite/32/123_2.png) [@Toxite](https://community.ultralytics.com/u/Toxite)\
**Post date:** [September 16, 2025, 10:00am UTC](https://community.ultralytics.com/t/onnx-with-nms-conversion-problem/1466/2 "2025-09-16T10:00:53Z")

</div>

Why do you expect that input and output?

The output of ONNX with NMS is explained here:

> **[Reddit - The heart of the internet](https://www.reddit.com/r/Ultralytics/comments/1jwl6se/ultralytics_postprocessing_guide/)**

---

<div class="post-metadata">

**Author:** ![Shree\_Dixit](https://sea1.discourse-cdn.com/flex001/user_avatar/community.ultralytics.com/shree_dixit/32/981_2.png) [@Shree\_Dixit](https://community.ultralytics.com/u/Shree_Dixit)\
**Post date:** [September 19, 2025, 11:32am UTC](https://community.ultralytics.com/t/onnx-with-nms-conversion-problem/1466/3 "2025-09-19T11:32:05Z")

</div>

Then what input and output should i expect and plz guide me what i have to do to get that kind of input and output

---

<div class="post-metadata">

**Author:** ![Toxite](https://sea1.discourse-cdn.com/flex001/user_avatar/community.ultralytics.com/toxite/32/123_2.png) [@Toxite](https://community.ultralytics.com/u/Toxite)\
**Post date:** [September 19, 2025, 1:04pm UTC](https://community.ultralytics.com/t/onnx-with-nms-conversion-problem/1466/4 "2025-09-19T13:04:30Z")

</div>

I linked the guide that explains the output from Ultralytics:

> **[Reddit - The heart of the internet](https://www.reddit.com/r/Ultralytics/comments/1jwl6se/ultralytics_postprocessing_guide/)**

---

<div class="post-metadata">

**Author:** ![Toxite](https://sea1.discourse-cdn.com/flex001/user_avatar/community.ultralytics.com/toxite/32/123_2.png) [@Toxite](https://community.ultralytics.com/u/Toxite)\
**Post date:** [September 19, 2025, 1:07pm UTC](https://community.ultralytics.com/t/onnx-with-nms-conversion-problem/1466/5 "2025-09-19T13:07:49Z")

</div>

> plz guide me what i have to do to get that kind of input and output

Ultralytics doesn’t provide support for those inputs and outputs that you listed in your post. I am not sure where you found those from and why you want those specifically. You should explain what you’re trying to do.
