-
-
Notifications
You must be signed in to change notification settings - Fork 16.8k
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
YOLOv5 Output Size Issue #13008
Comments
👋 Hello @lllittleX, thank you for your interest in YOLOv5 🚀! 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 a minimum reproducible example to help us debug it. If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results. RequirementsPython>=3.8.0 with all requirements.txt installed including PyTorch>=1.8. To get started: git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install EnvironmentsYOLOv5 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 YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training, validation, inference, export and benchmarks on macOS, Windows, and Ubuntu every 24 hours and on every commit. Introducing YOLOv8 🚀We're excited to announce the launch of our latest state-of-the-art (SOTA) object detection model for 2023 - YOLOv8 🚀! Designed to be fast, accurate, and easy to use, YOLOv8 is an ideal choice for a wide range of object detection, image segmentation and image classification tasks. With YOLOv8, you'll be able to quickly and accurately detect objects in real-time, streamline your workflows, and achieve new levels of accuracy in your projects. Check out our YOLOv8 Docs for details and get started with: pip install ultralytics |
@lllittleX hello! Thanks for reaching out with your question about the output size from the YOLOv5 model when converted to ONNX. The output sizes you are seeing (e.g., Ensure that your input image size is a multiple of the largest factor (generally 32) to maintain consistent grid dimensions across the different layers. You can adjust this in your initial configuration before training or inference. Let's verify that input sizes and model configurations align with the expected outputs. Good luck with your conversions! 🚀 |
Hi there!
The same model in train mode gives only the 2nd output. At first I thought just stacking them would give me the same tensor as output1 but then I compared the values to see they are completely different even after applying softmax to them. Now for my problem: |
@VishnuRao27 for knowledge distillation in YOLOv5, ensure both teacher and student models are in train mode to access raw feature outputs (output 2). The three tensors in the list correspond to detection layers at different scales. To align outputs:
Example reshaping: student_output = torch.cat([x.view(x.shape[0], -1, x.shape[-1]) for x in train_output], 1)
teacher_output = torch.cat([x.view(x.shape[0], -1, x.shape[-1]) for x in teacher_train_output], 1) For implementation details, see the YOLOv5 |
Hi @pderrenger ! Thank you for your reply
This is also the output of the 3 detection layers not concatenated yet right? Edit: So if I follow the steps, use that code snippet that you shared above and get the outputs and apply sigmoid to them, I will basically get the output1 that is returned along with output 2 in the inference mode right? |
Yes, when using |
Search before asking
Question
I want to convert the results to ONNX first, and then to RKNN. However, when testing the ONNX model, I found that my output sizes are as follows:
torch.Size([1, 15120, 133])
torch.Size([1, 3, 48, 80, 133])
torch.Size([1, 3, 24, 40, 133])
torch.Size([1, 3, 12, 20, 133])
But from what I understand, the usual size is 80,80 instead of 48,80. I would like to ask if this is normal?
Additional
No response
The text was updated successfully, but these errors were encountered: