-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to using onnx model? #1800
Comments
👋 Hello @Sun-Pak, thank you for your interest in YOLOv3 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution. If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you. If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available. For business inquiries or professional support requests please visit https://www.ultralytics.com or email Glenn Jocher at [email protected]. RequirementsPython 3.8 or later with all requirements.txt dependencies installed, including $ pip install -r requirements.txt EnvironmentsYOLOv3 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf this badge is green, all YOLOv3 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv3 training (train.py), testing (test.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit. |
👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs. Access additional YOLOv3 🚀 resources:
Access additional Ultralytics ⚡ resources:
Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed! Thank you for your contributions to YOLOv3 🚀 and Vision AI ⭐! |
@matiassalriv1998 your ONNX model is out of date, export a new model with current code: |
@matiassalriv1998 for C inference see export tutorial |
What I'm actually looking for is to get some light on how to interpretate the output tensor. That's the most important. One thing I don't understand also is why 1x25200x7?? In older versions that numbers changes... Here I paste my model with the latest version of yolo trained and exported: After trying some changes on the script I got 4 output tensors by modifying the export.py according to: ultralytics/yolov5#343 (comment)), however I already have a code in C# which works with 3 output tensors with the standard form (1,3,20,20,7) (1,3,40,40,7) (1,3,80,80,7) which I would also like to know more about. There's a lot of old information about and is a bit confusing for me, I would like some newer information which allows me to understand the tensor values, that's the most important for me. |
@matiassalriv1998 ONNX inference is very easy, just follow the Usage examples shown after export: |
As I mentioned before, inference is not my problem, I already know how to do an inference with that python line, the main goal I folow is to understand about the output tensor of .onnx model and why the numbers of the array by using the official Yolo repo [1,2500,7] or others I have seen at some places. What I'm needing is to parse that output tensor (in C sharp) so I want to understand its form, there are ways to generate 4 tensors or 3 tensors as I explained before. Even I made a representative document with each visualization at netron.app for different configurations of export.py. But that's my particular case, I'm just asking for some information about the output tensor form and its values. |
Dimension 2 indices are xywh, conf, class confidences |
(1, 25200, 7) Is my output tensor shape: ->1 is the batch size (set when exporting to .onnx) ->25200 is the bounding boxes number. ->7 according to @glenn-jocher comes from: [x y w h conf class0Conf class1Conf...] in my case I have 2 class detections so I Tensor apparence is a float table of 25200x7 in my model. Actually I will try to process this tensor output instead of what I was doing with old code processing 3 tensors (1,80,7), (1,40,7),(1,20,7) which mades me export onnx by changing some parameters actually. But at least now I have some understanding about the tensor values. I hope this have helped someone :) |
@matiassalriv1998 thanks for sharing your understanding of the output tensor's shape and values. It's great to see you've made progress in decoding the tensor output, and your explanation will certainly be helpful to others. If you have further questions or need additional assistance, feel free to ask! |
❔Question
i create onnx model. using export.py. (using tutorial)
I loaded the onnx model, but don't know how to check the result.
I checked that the number of inputs is 1 and the number of outputs is 4,
I don't know why output is 4. I know that there should be 3 outputs.
i need help how i use it.
Additional context
And i edit onnx export in export.py
output_name = ['output']
In Netron
I can't understand that result.
The text was updated successfully, but these errors were encountered: