ultralytics / yolov5

YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
49.72k stars 16.12k forks source link

Can't See training process logging during training until the training finish on jupyter notebook #12290

Closed tgbaoo closed 9 months ago

tgbaoo commented 10 months ago

Search before asking

YOLOv5 Component

No response

Bug

image I can't see the training process during execute train.py from yolov5 on jupyter notebook

They just keep show nothing like this(althought I took the screen shot pretty fast but it just keep showing nothing until everything done!, Help me solve this issue please image

Environment

No response

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

github-actions[bot] commented 10 months ago

👋 Hello @tgbaoo, 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):

Status

YOLOv5 CI

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
glenn-jocher commented 10 months ago

@tgbaoo hi there,

Apologies for the inconvenience you're experiencing during the training process in Jupyter Notebook. This issue might be related to the logging configuration in Jupyter Notebook.

To enable the training process logging, you can try the following steps:

  1. Import the wandb library at the beginning of your Jupyter Notebook script:

    import wandb
  2. Initialize the wandb logger with the line below before starting the training loop:

    logger = wandb.init()
  3. Pass the logger object to the train.py script using the --logger argument:

    !python train.py --data data.yaml --cfg models/yolov5s.yaml --logger $logger

With these steps, the training process should be visible in the Jupyter Notebook output.

Let me know if this resolves your issue. If you have any further questions, feel free to ask.

Thanks!

tgbaoo commented 10 months ago

Nevermind, appreciate your work and your passion on building a whole lib for the community, and also your support, I will try and have some report on this post soon.

glenn-jocher commented 10 months ago

@tgbaoo thank you for your kind words! We appreciate your support and enthusiasm. We look forward to hearing your report. If you have any further questions or need any assistance, please don't hesitate to ask.

tgbaoo commented 10 months ago

I have tried but I can't enable wandb on jupyter notebook, by the way I have found that you already integrate yolov5 on ultralytics, then I solved my case by using ultralytics syntax with yolov5(u) weight (which weight that I read on your docs say that using adapt anchor free to compatible with ultralytics right? Now my project move on to new milestone is that detect small golf ball and golf hole and tracking, I tend to use SAHI and tracking combine together, like I am new and lack of knowledge on computer vision field but I willing to learn, so It's my pleasure that having your help and consult to solve my next milestone. If you read this, could we discuss this topic on somewhere else after I close this issue? Thanks you for your help and have a good day! @glenn-jocher

P/s:

This is my result of training golf ball and hole dataset: results

And this is my dataset URL: https://app.roboflow.com/sai-gon-university/golf-ball-and-hole-detection-1k7/1

glenn-jocher commented 10 months ago

@tgbaoo thank you for your message and for sharing your progress with us. We're glad to hear that you were able to solve your previous issue by using the Ultralytics syntax with YOLOv5(u) weights.

Detecting small objects like a golf ball and hole can be challenging. To improve detection performance, you might consider trying different approaches such as:

We would be happy to help and provide guidance on your next milestone. However, please note that it would be more appropriate to discuss this topic on our official YOLOv5 discussions forum or relevant platforms. This will allow the community to benefit from the discussion, and other users can also contribute their insights and experiences.

Thank you for providing the link to your dataset. We'll check it out and see if there are any specific recommendations we can make to help improve your results.

Keep up the great work, and please don't hesitate to reach out if you have any further questions or need any assistance. Have a wonderful day!

tgbaoo commented 10 months ago

So could you give me some place to discuss this problem together? I have done some research, also you recommend some method like training use yolov8-p2.yaml for optimize for small dataset, I tend to move to yolov8. Could I reach you guys ơn github or discord or somewhere else?

glenn-jocher commented 10 months ago

@tgbaoo thank you for reaching out and for your interest in discussing your project. We appreciate your efforts in researching and exploring different strategies for optimizing your dataset.

For further discussions and support, we recommend visiting the official YOLOv5 discussions forum. This platform provides a dedicated space for the community to come together, share ideas, and seek assistance or guidance from other users. You can post your questions or join existing threads to engage with the community and interact with multiple perspectives. We believe this will provide you with a broader range of insights and expertise to help you with your project.

Please note that we cannot provide direct assistance through personal channels like GitHub or Discord. However, the YOLOv5 discussions forum is an active and supportive community where you can receive guidance and feedback from both the Ultralytics team and fellow users.

Once again, thank you for your contributions, and we hope the discussions forum will be a valuable resource for you. If you have any further questions or need assistance, feel free to ask on the forum. Good luck with your project!

tgbaoo commented 10 months ago

@glenn-jocher Like if I use YOLO, then when I use some advanced inference method such as SAHI, then it all show me up error something like:

raise TypeError("model_path is not a valid yolov5 model path: ", e)
TypeError: ('model_path is not a valid yolov5 model path: ', AttributeError("'Detect' object has no attribute 'grid'"))

I guess this come from the modify from the model architecture or class/method modification from 2 difference source code ultralytics (with yolov5u model architecture) and the original yolov5 github source code (the original yolov5s)

Hope this help you to identified the issue!

Like when I use the YOLO it's auto choose the yolov5u model, but I want is original yolov5, so could you help me when I run the train.py file on the original github yolov5 repo?

glenn-jocher commented 10 months ago

@tgbaoo It seems that you're encountering an error when using YOLOv5 with advanced inference methods such as SAHI. The error message indicates that the attribute grid is not available in the Detect object. This issue might be due to modifications in the model architecture or changes in class/method implementations between the Ultralytics yolov5u model and the original yolov5 model from the GitHub repository.

To address this issue, if you want to use the original yolov5 model instead of the yolov5u model chosen automatically, you can modify the train.py file in the original yolov5 GitHub repository. You can specify the desired yolov5 model architecture in the configuration file or directly in the train.py script. Additionally, ensure that all necessary class and method modifications are applied consistently.

Please note that making these modifications might require a good understanding of the code structure and dependencies. It's recommended to carefully review the codebase and consult the official yolov5 documentation or the yolov5 GitHub repository for further guidance.

Good luck, and I hope this helps you resolve the issue. Let me know if you have any further questions or need assistance.

github-actions[bot] commented 9 months ago

👋 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:

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 ⭐