Comments (5)
π Hello @zengweigit, 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.
Requirements
Python>=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
Environments
YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
- Notebooks with free GPU:
- Google Cloud Deep Learning VM. See GCP Quickstart Guide
- Amazon Deep Learning AMI. See AWS Quickstart Guide
- Docker Image. See Docker Quickstart Guide
Status
If 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
from yolov5.
@zengweigit hello,
Thank you for reaching out and providing details about your issue. To assist you effectively, we need a bit more information. Could you please provide a minimum reproducible code example? This will help us better understand the context and reproduce the issue on our end. You can refer to our guide on creating a minimum reproducible example here: Minimum Reproducible Example.
Additionally, please ensure that you are using the latest versions of torch
and the YOLOv5 repository. Sometimes, updates can resolve unexpected issues.
Regarding your specific problem with the prediction ratios, here are a few optimization suggestions:
- Class Imbalance: Ensure that your dataset is balanced across all classes. An imbalanced dataset can lead to biased predictions.
- Hyperparameter Tuning: Experiment with different hyperparameters such as learning rate, batch size, and epochs. Sometimes, fine-tuning these can improve model performance.
- Data Augmentation: Apply data augmentation techniques to increase the variability of your training data, which can help the model generalize better.
- Validation Set: Make sure you have a separate validation set to monitor the performance of each class during training.
If you can share more details or the code snippet, we can provide more targeted advice. Thank you for your cooperation, and we look forward to helping you resolve this issue.
from yolov5.
I used the code from the https://github.com/ultralytics/yolov5/tree/v7.0 branch
The training command I executed was
python -m torch.distributed.run --nproc_per_node 2 train.py --data data/new_data.yaml --cfg models/new_yolov5s.yaml --weights pretrained/yolov5s.pt --epochs 100 --batch-size 256 --workers 16 --device 0,1 --cache ram --hyp data/hyps/hyp.scratch-med.yaml
What does class imbalance mean? Does it mean that the number of annotations for my no_helmet class is different from the number of annotations for the wrong_glove class? Or does it mean something else?
from yolov5.
Hello @zengweigit,
Thank you for providing the details of your setup and the training command you used. Itβs great to see that you are using the code from the v7.0
branch.
To address your question about class imbalance: Yes, class imbalance refers to a situation where the number of annotations (or instances) for each class in your dataset is significantly different. For example, if you have many more annotations for the no_helmet
class compared to the wrong_glove
class, your model might become biased towards predicting the more frequent class.
Steps to Address Class Imbalance:
- Data Augmentation: Increase the number of instances for the minority class using data augmentation techniques. This can help balance the dataset.
- Resampling: You can either oversample the minority class or undersample the majority class to balance the dataset.
- Class Weights: Adjust the loss function to give more importance to the minority class. This can be done by setting class weights.
Example of Setting Class Weights:
You can modify the hyp.scratch-med.yaml
file to include class weights. Hereβs an example:
# Add class weights to the hyperparameters
cls: 0.5 # Class loss gain (original value)
cls_pw: [1.0, 2.0] # Class weights for each class, adjust as needed
Verify Latest Versions:
Please ensure that you are using the latest versions of torch
and the YOLOv5 repository. Sometimes, updates can resolve unexpected issues. You can update your repository with:
git pull
Minimum Reproducible Example:
If the issue persists, could you please provide a minimum reproducible code example? This will help us better understand the context and reproduce the issue on our end. You can refer to our guide on creating a minimum reproducible example here: Minimum Reproducible Example.
Feel free to reach out if you have any more questions or need further assistance. We're here to help! π
from yolov5.
π Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.
For additional resources and information, please see the links below:
- Docs: https://docs.ultralytics.com
- HUB: https://hub.ultralytics.com
- Community: https://community.ultralytics.com
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 YOLO π and Vision AI β
from yolov5.
Related Issues (20)
- Syntax and understanding questions about reading tensorflow lite results HOT 1
- A Error which blast my mind.... HOT 1
- Yolov5 Int8 export in PyTorch HOT 10
- Video inference with YOLOv5 model in python HOT 3
- How to disable or add new scales of prediction? HOT 5
- Installation on Windows 7 32 bits HOT 3
- Artificial Neural Network - interpreting model.save output HOT 1
- Origin of warmup_bias_lr? HOT 3
- Silicon Mac GPU Support for training HOT 1
- Split features map of data HOT 1
- incorrect detections for cars after fine-tuning yolov5l HOT 1
- tried to run yolov5 "detect.py" with pretrained model yolov8x.pt and xView.yaml HOT 1
- Low disk space causes memory leak HOT 3
- Error with fbgemm.dll file when using Torch! HOT 5
- Yolov5 inventing label on validation set HOT 1
- challenges faced in Xtream1 tool while creating class ID's HOT 1
- Facing issues while changing class ID values HOT 1
- background color of image and other causes? HOT 1
- ModuleNotFoundError: No module named 'models.yolo'. HOT 3
- RuntimeError: The size of tensor a (80) must match the size of tensor b (60) at non-singleton dimension 3 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yolov5.