-
-
Notifications
You must be signed in to change notification settings - Fork 16.3k
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
The advantage of yolov5s #5730
Comments
👋 Hello @liang-jingyi, 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 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://ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com. RequirementsPython>=3.6.0 with all requirements.txt installed including PyTorch>=1.7. To get started: $ git clone https://github.com/ultralytics/yolov5
$ cd yolov5
$ pip install -r requirements.txt 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 (train.py), validation (val.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit. |
@liang-jingyi |
Yes, I wonder why yolov5s is so much more accurate than Yolov4Tiny. |
@liang-jingyi it's more accurate because of thousands of hours of experiments I ran when developing it and a multitude of improvements such as target assignment, improved augmentation, SiLU activations, EMA, C3 modules, an extra P5 output head (tiny has only P3, P4), and more layers in general. In general the tiny models are faster but also larger and with much worse accuracy (basically unusable in real-world products). |
@glenn-jocher When I compared the network structure, I found that you stacked three C3s in a row in two places on the backbone network, and you used CON instead of pool. Is that one of the reasons for yolov5S's success? Thank you very much |
@liang-jingyi no. C3() modules are evolved CSPBottleneck() modules with the least productive of of the 4 modules removed, leaving 3 (hence the name), and also achieving a few more efficiencies at fuse time. The benefit is not improved accuracy, it's less layers and parameters and faster speeds. |
@glenn-jocher Thank you very much for your answer! It helps me a lot. |
@Zengyf-CVer @glenn-jocher I constructed the yolov4tiny.cfg file using the Yolov5 framework. Why is the weight file trained by me much smaller than the weight file trained by the yolov4 authors?I trained them to be even smaller than Yolov5s. The yolov4Tiny model I constructed has a parameter of 6 million.I don't understand why. Please help me |
@liang-jingyi
|
@Zengyf-CVer Sorry, I misdescribed, the file I built is yaml format, not cfg file parametersnc: 80 # number of classes anchorsanchors:
YOLOv4-tiny backbonebackbone: [from, number, module, args][[-1, 1, BasicConv, [32, 3, 2]], # 0 [-1, 1, BasicConv, [64, 3, 1]], [-1, 1, nn.MaxPool2d, [2, 2, 0]], # 5-P3/8 [-1, 1, BasicConv, [128, 3, 1]], [-1, 1, nn.MaxPool2d, [2, 2, 0]], # 9-P4/16 [-1, 1, BasicConv, [256, 3, 1]], [-1, 1, nn.MaxPool2d, [2, 2, 0]], # 13-P5/32 [-1, 1, BasicConv, [512, 3, 1]], YOLOv4-tiny headhead: [-2, 1, BasicConv, [128, 1, 1]], # 17 (P5/32-large) [[20, 16], 1, Detect, [nc, anchors]], # Detect(P4, P5) common.py I created two class. class BasicConv(nn.Module):
class BConv(nn.Module):
Please forgive me for not being able to upload the file. The network speed is too slow.Thank you very much for your reply. |
@liang-jingyi
|
@Zengyf-CVer |
@liang-jingyi |
@liang-jingyi I don't have time to examine the yaml file but typically if you are constructing a yaml and the yaml contents don't match the YOLOv4 publication expectations (i.e. parameter count) then I would suspect user error on the yaml author's part. |
@glenn-jocher @Zengyf-CVer Maybe I could answer the question in a different way. Yolov5s has more parameters than yolov4-tiny. Why is the file size of yolov5s.pt smaller than yolov4-tiny.pt? |
@liang-jingyi |
👋 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 YOLOv5 🚀 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 YOLOv5 🚀 and Vision AI ⭐! |
Hi, @liang-jingyi could I request the yolov4-tiny file you build? and how is your prgoress of testing? thank you in advance. |
Hi @ys31jp, it seems the file size difference you're observing could be due to various factors such as data types, compression, or differences in architecture between yolov5s and yolov4-tiny. Have you considered analyzing the weight files to check for any discrepancies? Also, could you provide more details on your training process and any progress with your testing? Thank you! |
Search before asking
Question
When I was learning yolov4Tiny and Yolov5s, I found a big difference in performance between the two, with yolov5S working much better. I want to know what makes this difference. I know that FPN and SPP can greatly improve yOLO network performance. In addition, I wonder if the number of C3 stacks is also an important factor. The higher the number of layers, the better the network performance. I'm confused. Please help me. Thank you!
Additional
No response
The text was updated successfully, but these errors were encountered: