Skip to content
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

请问这三个文件的区别?以及如何在程序中选择 #5653

Closed
1 task done
Wanghe1997 opened this issue Nov 15, 2021 · 15 comments
Closed
1 task done

请问这三个文件的区别?以及如何在程序中选择 #5653

Wanghe1997 opened this issue Nov 15, 2021 · 15 comments
Labels
question Further information is requested Stale Stale and schedule for closing soon

Comments

@Wanghe1997
Copy link

Search before asking

Question

1636981175(1)
作者您好,请问hyp.scratch这4个yaml文件有什么区别?各自是在什么样的情况下使用?程序应该在哪里选择使用哪个hyp.scratch文件呢?另外,标注红色方框的这两个yaml文件又有什么区别?

Additional

像这些细节性的问题(比如this question,或者是一些超参数的含义等等诸如此类细节性的问题)我好像在你们的tutorial里找不到相关的解释,是不是有些关于程序或者参数设置的问题你们在一些issue里面给出了答案呢?有时候我有一些关于你们程序参数的设置、含义等疑问不知道从哪里能找到解答。你们是否在一些issue里面整理了一些常见的疑问,如果有的话可以分享吗?

@Wanghe1997 Wanghe1997 added the question Further information is requested label Nov 15, 2021
@Wanghe1997
Copy link
Author

Wanghe1997 commented Nov 15, 2021

PS:Because I am from China, it is more convenient and time-saving to ask questions by using Chinese. I don’t know if you can understand the meaning of my question. If it’s not easy for you to understand, I will continue to ask questions in English in the future. lol

@Wanghe1997
Copy link
Author

Your tutorial, I feel that the writing is more general and broad, some detailed questions about the meaning of the parameters/files and how to configure them, where should I look for answers? Are there related issues that you sorted out or summarized?Thanks

@glenn-jocher
Copy link
Member

@Wanghe1997 hyp files are specified during training here, i.e. python train.py --hyp hyp.scratch.yaml

yolov5/train.py

Line 445 in c2523be

parser.add_argument('--hyp', type=str, default=ROOT / 'data/hyps/hyp.scratch.yaml', help='hyperparameters path')

  • finetune.yaml: evolved on VOC
  • finetune_objects365: evolved on Objects365
  • scratch: default
  • scratch_low: for smaller models, i.e. v5n, v5s
  • scratch_med: for medium models, i.e. v5m
  • scratch_high: for large models, i.e. v3, v3-spp, v5l, v5x

@Wanghe1997
Copy link
Author

Wanghe1997 commented Nov 19, 2021

@Wanghe1997 hyp files are specified during training here, i.e. python train.py --hyp hyp.scratch.yaml

yolov5/train.py

Line 445 in c2523be

parser.add_argument('--hyp', type=str, default=ROOT / 'data/hyps/hyp.scratch.yaml', help='hyperparameters path')

  • finetune.yaml: evolved on VOC
  • finetune_objects365: evolved on Objects365
  • scratch: default
  • scratch_low: for smaller models, i.e. v5n, v5s
  • scratch_med: for medium models, i.e. v5m
  • scratch_high: for large models, i.e. v3, v3-spp, v5l, v5x

Thank u.
Q1:Does scratch: default mean that all size models can be tried?Why should a small model set a small initial learning rate?
Q2:For small models(v5n,v5s), is it better to set the batch-size to a small value(8,16) or a large value(32,64,128) during the training process? Are there any techniques or arguments for the batch-size setting?

@glenn-jocher
Copy link
Member

@Wanghe1997 batch size should be set as large as possible to fully utilize your GPU.

AutoBatch

You can use YOLOv5 AutoBatch (NEW) to find the best batch size for your training by passing --batch-size -1. AutoBatch will solve for a 90% CUDA memory-utilization batch-size given your training settings. AutoBatch is experimental, and only works for Single-GPU training. It may not work on all systems, and is not recommended for production use.

Screenshot 2021-11-06 at 12 31 10

Good luck and let us know if you have any other questions!

@Wanghe1997
Copy link
Author

@Wanghe1997 batch size should be set as large as possible to fully utilize your GPU.

AutoBatch

You can use YOLOv5 AutoBatch (NEW) to find the best batch size for your training by passing --batch-size -1. AutoBatch will solve for a 90% CUDA memory-utilization batch-size given your training settings. AutoBatch is experimental, and only works for Single-GPU training. It may not work on all systems, and is not recommended for production use.

Screenshot 2021-11-06 at 12 31 10

Good luck and let us know if you have any other questions!
So according to the results of this picture, the best batch-size of the A100-SXM4 graphics card for training with 640 img-size on the coco128 data set is 179? Is my understanding correct?

@glenn-jocher
Copy link
Member

@Wanghe1997 yes

@Wanghe1997
Copy link
Author

AutoBatch

So just set batch-size to 1 in train.py, will the program automatically execute AutoBatch? No need to do any configuration other than that?

@glenn-jocher
Copy link
Member

@Wanghe1997 no, the screenshot shows -1, not 1

@Wanghe1997
Copy link
Author

@Wanghe1997 no, the screenshot shows -1, not 1

ok,thanks

@Wanghe1997
Copy link
Author

Wanghe1997 commented Nov 19, 2021

@Wanghe1997 no, the screenshot shows -1, not 1

I just tested AutoBatch with my dataset, and the best batch-size measured was 111. However, I used this value of 111 to train yolov5s, and it prompted an error: Unable to find a valid cuDNN algorithm to run convolution. I feel that the Autobatch test is not accurate! Although my graphics card is RTX3090, 24G memory, but theoretically it can't bear such a large batch-size

@glenn-jocher
Copy link
Member

@Wanghe1997 thank you for your feedback. As noted above:
Screenshot 2021-11-19 at 14 50 40

@Wanghe1997
Copy link
Author

@Wanghe1997 thank you for your feedback. As noted above: Screenshot 2021-11-19 at 14 50 40

You're welcome. My system is windows10, it happens to be tested with RTX3090 single card. It seems that AutoBatch is not accurate yet. Or it can only be calculated for coco128, not for custom datasets?

@glenn-jocher
Copy link
Member

@Wanghe1997 the dataset does not matter. It's only been evaluated on Colab instances with K80, T4, P100, V100, A100, so no consumer cards yet.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 20, 2021

👋 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 ⭐!

@github-actions github-actions bot added the Stale Stale and schedule for closing soon label Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested Stale Stale and schedule for closing soon
Projects
None yet
Development

No branches or pull requests

2 participants