Closed Denbergvanthijs closed 2 years ago
👋 Hello @Denbergvanthijs, 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.
Python>=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
YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
If 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.
@Denbergvanthijs 👋 hi, thanks for letting us know about this possible problem with YOLOv5 🚀. We've created a few short guidelines below to help users provide what we need in order to get started investigating a possible problem.
When asking a question, people will be better able to provide help if you provide code that they can easily understand and use to reproduce the problem. This is referred to by community members as creating a minimum reproducible example. Your code that reproduces the problem should be:
For Ultralytics to provide assistance your code should also be:
git pull
or git clone
a new copy to ensure your problem has not already been solved in master.If you believe your problem meets all the above criteria, please close this issue and raise a new one using the 🐛 Bug Report template with a minimum reproducible example to help us better understand and diagnose your problem.
Thank you! 😃
Hi @glenn-jocher , is the code I have provided minimal and reproducible enough for you? What can I do to make it better?
@Denbergvanthijs val.py operates correctly for me. If we can't reproduce an error on our side the issue is non-actionable.
Sorry if I was unclear, the coco128.yaml
does indeed work for me. The problem is that it doesn't work on my custom dataset.
I'm in doubt if my custom dataset is incorrect because when I run python ./yolov5/val.py --data "./data/rs19_person.yaml" --weights "yolov5n.pt" --batch-size 1 --task val --workers 1 --single-cls
it does work. The same goes for training from the command line, that also works for my custom dataset
@Denbergvanthijs if you can demonstrate an issue using any of the autodownload datasets (i.e. COCO, COCO128, VOC, etc.) then please let us know, thanks!
I will give it a go, thank you for your fast responses!
I have been able to solve my problem by adding if __name__ == "__main__":
to the script. Its still strange that 8 processes start when I run my script. But for now my problem is solved. Thank you for your assistance Glenn!
Search before asking
YOLOv5 Component
Validation
Bug
First of all, thank you for YOLOv5!
My repository has the following structure:
Within
my_script.py
I have the following code:Sadly, this code will start 8 processes and my computer gets stuck. However changing data="./data/rs19_person.yaml" to data="./yolov5/coco128.yaml" does work and will not start 8 processes.
The logs show the following and then my computer freezes and I have to force-close the console.
YOLOv5 v6.0-150-g361705d torch 1.10.0+cu113 CUDA:0 (NVIDIA GeForce GTX 1050, 2048MiB) Fusing layers... Model Summary: 213 layers, 1867405 parameters, 0 gradients val: Scanning 'data\rs19_person\labels\val' images and labels...: 0%| | 0/21 [00:00, ?it/s]YOLOv5 v6.0-150-g361705d torch 1.10.0+cu113 CUDA:0 (NVIDIA GeForce GTX 1050, 2048MiB) YOLOv5 v6.0-150-g361705d torch 1.10.0+cu113 CUDA:0 (NVIDIA GeForce GTX 1050, 2048MiB) YOLOv5 v6.0-150-g361705d torch 1.10.0+cu113 CUDA:0 (NVIDIA GeForce GTX 1050, 2048MiB) YOLOv5 v6.0-150-g361705d torch 1.10.0+cu113 CUDA:0 (NVIDIA GeForce GTX 1050, 2048MiB) YOLOv5 v6.0-150-g361705d torch 1.10.0+cu113 CUDA:0 (NVIDIA GeForce GTX 1050, 2048MiB) YOLOv5 v6.0-150-g361705d torch 1.10.0+cu113 CUDA:0 (NVIDIA GeForce GTX 1050, 2048MiB) YOLOv5 v6.0-150-g361705d torch 1.10.0+cu113 CUDA:0 (NVIDIA GeForce GTX 1050, 2048MiB) Fusing layers... Fusing layers... Fusing layers... Fusing layers... Fusing layers... Fusing layers...Environment
Minimal Reproducible Example
A folder with the following files and folders inside:
A file
my_script.py
with the following code:The yaml contains the following:
Additional
I understand that
val.py
is just a basic script and not meant for production, it does however serve my needs and I would really like to use it. Thank you very much for your time!P.S. the whole repository can be found at https://github.com/Denbergvanthijs/railsem19_yolov5 This is a W.I.P. still though.
Are you willing to submit a PR?