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

Training #10232

Closed
1 task done
Mrinh212375 opened this issue Nov 21, 2022 · 5 comments
Closed
1 task done

Training #10232

Mrinh212375 opened this issue Nov 21, 2022 · 5 comments
Labels
question Further information is requested Stale

Comments

@Mrinh212375
Copy link

Search before asking

Question

I have already trained the yolov5 model with the dataset having 33K images (31 classes), got the best.pt and last.pt. Now I want to train the model on some images that I have clicked by my phone, Now I have two queries -

  1. I'll have to train from best.pt rather than yolov5s.pt, right?
  2. if I need that after this training also my model will have the capability to detect 31 classes + some classes from my images, then I have to use the .yaml file that was used previously with some classes added, isn't it? but then during this training I may not have sufficient images which justify 31+some more classes.

actually, I need to augment the learning from my real images. Am I going right ??

Additional

No response

@Mrinh212375 Mrinh212375 added the question Further information is requested label Nov 21, 2022
@MartinPedersenpp
Copy link

MartinPedersenpp commented Nov 21, 2022

Hello @Mrinh212375
Your best and last.pt files are the results of the transfer learning process which has shifted the layer weights of the model towards recognizing your N classes.
If you want to continue training with more images/classes you need to keep the dataset which was used to achieve the best/last.pt files and add your new data to the dataset.
So if you add new classes, you must modify your dataset.yaml file to reflect your classes.
If you only add new images of the same classes, you only need to add the images with their labels.

If you only train on your new data, the model will get shifted away from your original dataset, as far as I know.

I hope this helps

@Mrinh212375
Copy link
Author

@MartinPedersenpp so , you mean if I'll give the dataset.yaml with some more added class and only the images of my own as dataset, then the model will get shifted to my new data, means it may not detect the images from the first dataset, right ??

@Mrinh212375
Copy link
Author

@MartinPedersenpp , actually my guide was saying that it'll augment the learning, and is there any freeze mechanism so that I can freeze some layers which incurs some normalization(if any :-(

@MartinPedersenpp
Copy link

MartinPedersenpp commented Nov 21, 2022

@MartinPedersenpp , actually my guide was saying that it'll augment the learning, and is there any freeze mechanism so that I can freeze some layers which incurs some normalization(if any :-(

Quick google:
https://docs.ultralytics.com/yolov5/tutorials/transfer_learning_with_frozen_layers

I can't say that I have tested it, but if you have trained on dataset1 and then train on dataset2 which misses some of the classes then it can't validate if the weights fit those classes.
I found this: #3258

Hope it helps

@github-actions
Copy link
Contributor

github-actions bot commented Dec 22, 2022

👋 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 label Dec 22, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 1, 2023
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
Projects
None yet
Development

No branches or pull requests

2 participants