Giter VIP home page Giter VIP logo

Comments (6)

zp2546265641 avatar zp2546265641 commented on July 24, 2024 1

i ask the gpt, it tells me to disable AMP with amp=False. and it will skip the check! i want to know the use of amp check? if i disable it? then what impact will it bring?

from ultralytics.

zp2546265641 avatar zp2546265641 commented on July 24, 2024 1

oh!!!my goad!!! after my training, my best.pt now only can detect the rotor, other classes all miss! and maybe the sample is too less, only 10 .png, the detection effect is very poor, how can i improve my detection?

from ultralytics.

zp2546265641 avatar zp2546265641 commented on July 24, 2024

oh!i just use yolov8s.pt and renamed "yolov8s_rotor.pt" as pretrained model, but when i use yolov8n.pt and renamed "yolov8n_rotor.pt", and then "TensorBoard: Start with 'tensorboard --logdir runs/detect/train', view at http://localhost:6006/
Freezing layer 'model.22.dfl.conv.weight'
AMP: running Automatic Mixed Precision (AMP) checks with YOLOv8n...
Downloading https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov8n.pt to 'yolov8n.pt'...
AMP: checks skipped ⚠️, offline and unable to download YOLOv8n. Setting 'amp=True'. If you experience zero-mAP or NaN losses you can disable AMP with amp=False.
train: Scanning /home/zp/rm_ws/src/dual_visual/Yolov8_ros/yolov8_ros/data/train/labels... 10 images, 0 backgrounds, 0 corrupt: 100%|██████████| 10/10 [00:00<00:00, 77.54it/s]"!

then it skip downloading!!! and so whatsi the problem? but when i train the twice,

#!/home/zp/anaconda3/envs/yolov8/bin/python3

-- coding: utf-8 --

from ultralytics import YOLO
import rospkg
rospack = rospkg.RosPack()
yolov8_ros_path = rospack.get_path('yolov8_ros')
model = YOLO(f"{yolov8_ros_path}/weights/yolov8n_rotor.pt") # load a pretrained model (recommended for training)

Train the model with GPU

results = model.train(data=f"{yolov8_ros_path}/data/yolov8.yaml", epochs=100, imgsz=640, workers=16,device=0)
it comes again:

TensorBoard: Start with 'tensorboard --logdir runs/detect/train', view at http://localhost:6006/
Freezing layer 'model.22.dfl.conv.weight'
AMP: running Automatic Mixed Precision (AMP) checks with YOLOv8n...
Downloading https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov8n.pt to 'yolov8n.pt'...
10%|█████████████▊ | 640k/6.23M [01:32<13:51, 7.07kB/s]
and the downloading speed is so slow!

from ultralytics.

glenn-jocher avatar glenn-jocher commented on July 24, 2024

Hello!

It sounds like you're encountering a common issue when adding new classes to a pretrained model. Here are a few steps to improve your model's detection capabilities:

  1. Increase Dataset Size: 10 images are quite minimal for training a robust model. Try to increase the number of images for the new class. More diverse and numerous training examples will help improve the model's ability to generalize.

  2. Rebalance Dataset: Ensure that your dataset includes a balanced number of images for each class. An imbalance can lead the model to favor the overrepresented classes.

  3. Data Augmentation: Implement data augmentation to artificially expand your training dataset. This includes transformations like rotation, scaling, flipping, and color adjustment.

  4. Fine-tuning: Instead of training from scratch, continue training (fine-tuning) from a model that has already been trained on other classes. This helps the model retain knowledge learned from the original dataset.

  5. Regular Evaluation: Frequently validate your model on a separate validation set to monitor its performance on unseen data. This helps in catching overfitting early.

  6. Hyperparameter Tuning: Experiment with different learning rates, batch sizes, and other training parameters. Sometimes minor adjustments can lead to significant improvements.

By expanding your dataset and ensuring a balanced, diverse set of training examples, you should see an improvement in your model's performance. Keep iterating and good luck!

from ultralytics.

zp2546265641 avatar zp2546265641 commented on July 24, 2024

Hello!

It sounds like you're encountering a common issue when adding new classes to a pretrained model. Here are a few steps to improve your model's detection capabilities:

  1. Increase Dataset Size: 10 images are quite minimal for training a robust model. Try to increase the number of images for the new class. More diverse and numerous training examples will help improve the model's ability to generalize.
  2. Rebalance Dataset: Ensure that your dataset includes a balanced number of images for each class. An imbalance can lead the model to favor the overrepresented classes.
  3. Data Augmentation: Implement data augmentation to artificially expand your training dataset. This includes transformations like rotation, scaling, flipping, and color adjustment.
  4. Fine-tuning: Instead of training from scratch, continue training (fine-tuning) from a model that has already been trained on other classes. This helps the model retain knowledge learned from the original dataset.
  5. Regular Evaluation: Frequently validate your model on a separate validation set to monitor its performance on unseen data. This helps in catching overfitting early.
  6. Hyperparameter Tuning: Experiment with different learning rates, batch sizes, and other training parameters. Sometimes minor adjustments can lead to significant improvements.

By expanding your dataset and ensuring a balanced, diverse set of training examples, you should see an improvement in your model's performance. Keep iterating and good luck!
nice to receive your reply!
Normally, how many pictures are needed for a class to ensure a good effect? I use the original yolov8n.pt model and add the categories and corresponding images I need to resume training(config: resume: true). Do I need to download the original dataset (which contains a lot of images and takes up a lot of local memory)?

from ultralytics.

glenn-jocher avatar glenn-jocher commented on July 24, 2024

@zp2546265641 hello!

Great questions! The number of images required for effective training can vary widely depending on the complexity of the objects and the variability in the images. Generally, a few hundred images per class are recommended for a robust model, but more can be beneficial, especially in complex scenarios.

Regarding your training setup, using the resume: true configuration with the original yolov8n.pt and adding your categories is a good approach. You don't necessarily need to download the entire original dataset if you're continuing training with additional classes. Just ensure your added dataset is sufficiently representative of the conditions under which you expect the model to perform.

Keep focusing on gathering quality, varied data for your new classes, and you should see improvements. Good luck! 🚀

from ultralytics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.