Comments (16)
You must train with 5000+500=5500 images simultaneously.
from yolov7.
So that means, once I get a weight file after training with the initial 5000 images (1024 x 1024), there is no way to improve upon the weight file with new data?
from yolov7.
Yes, there is not other way. You have to train with combined data which will generate 1 weight file. May I know why were you doing so?
from yolov7.
I had collected about 5000 labelled images initially to train the model on a custom dataset. However, I am getting new images everyday which need to be used for training the model. How can I go about doing this? Because if I have to retrain the model with all the images every time I get new images, I am not getting the use of transfer learning.
To give you a better picture of what I am trying to accomplish, I trained the model on 5000 images (1024x 1024) using:
python train.py --workers 8 --device 0 --batch-size 8 --data data/data.yaml --img 1024 1024 --cfg cfg/training/yolov7.yaml --weights '' --name yolov7 --hyp data/hyp.scratch.p5.yaml
After this, I have gotten a 'best.pt' weight file, which I used for the following training on 500 images using the transfer learning code line:
python train.py --workers 8 --device 0 --batch-size 4 --data data/custom.yaml --img 3072 3072 --cfg cfg/training/yolov7-custom.yaml --weights 'best.pt' --name yolov7-custom --hyp data/hyp.scratch.custom.yaml
I am using an NVIDIA A100 80 GB GPU virtual machine.
from yolov7.
As I said, you have to add new data to your existing dataset and retrain the model from scratch.
I am assuming you have to retrain with new images since your existing trained model is unable to detect in new images, right?
from yolov7.
So i have a set of 20 images I am using for benchmarking different versions of the model. Lets call the weight file from training 5000 images as 5000.pt, and then I am using transfer learning to train over the initially trained model using the 5000.pt as the weight file for the new 500 images.
However, when testing, the detection from 5000.pt is better than the new weight file I am getting after training on additional 500 images.
While writing this, something occured to me, do I have to increase the number of classes in the cfg file and use that in the following line?
python train.py --workers 8 --device 0 --batch-size 4 --data data/custom.yaml --img 3072 3072 --cfg cfg/training/yolov7-custom.yaml --weights 'best.pt' --name yolov7-custom --hyp data/hyp.scratch.custom.yaml
from yolov7.
are you saying, the number of classes in 5000 image dataset is different to the 500 image dataset?
from yolov7.
The number of classes stays the same, so should I make a new yolov7-custom.yaml file and write the custom number of classes, and then use that?
I think I might be missing some fundamental knowledge, because to me this sounds like this model can't be used for continuous improvement with new datasets?
from yolov7.
The number of classes(nc) must be changed in your data/custom.yaml and cfg/training/yolov7-custom.yaml from default(80) to yours.
from yolov7.
So if I do this I can do incremental training? Meaning, suppose I get 500 images every week, and I want to improve the model, I can train the model with 500 images every week with the weight file from the previous week?
from yolov7.
No, you cannot.
You have to add new image to your existing 5000 dataset and then start training using command-
python train.py --workers 8 --device 0 --batch-size 8 --data data/data.yaml --img 1024 1024 --cfg cfg/training/yolov7.yaml --weights '' --name yolov7 --hyp data/hyp.scratch.p5.yaml
Here weight will be retained yolo not the weight you trained earlier like 5000.pt.
from yolov7.
So basically, everytime I get new data, I need to train the model from scratch? So I can't improve the model with new data?
from yolov7.
This is the only way we follow with our custom data.
Every time the new images we get where detection is failing, we annotate--add those in the existing dataset--and retrain the model from starting.
from yolov7.
So could you please give me use case of transfer learning (I think I am unable the understand the point of the transfer learning code in this case)? Thank you for your help.
from yolov7.
This is transfer learning only- train a custom dataset using a pre-trained weight to detect our custom classes.
Only the way you were doing is wrong.
from yolov7.
Can i get in touch with you through whatsapp? Need some guidance, and you seem very experienced in this matter. My email ID - [email protected].
from yolov7.
Related Issues (20)
- why the test result and valid result on the same dataset is different? HOT 1
- My device uses a Radeon Instinct MI25 MxGPU, is this compatible with Yolov7? HOT 1
- Need help with deployment HOT 7
- How to add more epochs and resume training (with optimizer state), after all training epochs are finished?
- Incurred problem during training on 4090 HOT 1
- CUDA out of memory during training HOT 2
- Yolov7 confusion matrix with background FP=1 and TN=0
- [bug] AttributeError: module 'numpy' has no attribute 'int' while training model on custom dataset for image segmentation task HOT 1
- Change from yolov3 to yolov7 HOT 2
- face recognition HOT 1
- shape inference of TRT::EfficientNMS_TRT type is missing HOT 1
- Transfer Learning for Custom Object Detection HOT 1
- Is incremental training possible?
- Hyper-parameter optimization of YOLOv7 model
- Real-time video detection detect.py
- Why yolov7-seg YOLOR head doesn't use implicitM ?
- How Confidence Score Calculated?
- wandb
- scratch weights
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 yolov7.