PyTorch_YOLOv4 icon indicating copy to clipboard operation
PyTorch_YOLOv4 copied to clipboard

Add Weights & Biases Logging support

Open AyushExel opened this issue 4 years ago • 9 comments

This PR adds support for debugging models using W&B, only if the library is already found installed. When using W&B, users of YOLOV5 can debug their models easily inside a customizable dashboard by logging & comparing performance metrics, system usage metrics (like GPU memory), and predictions.

Features:

  • Bounding Box Debugging

Debug your bounding box predictions in real-time. 4d482f8f.gif

  • Automatically log and compare the performance of multiple models

ezgif com-resize

  • Supports Resuming

When training is resumed from a previous checkpoint, the metrics and images will continue to be logged in the same W&B dashboard if it exists, otherwise, a new W&B run will be created

  • Adds no dependencies

The library will work as it is supposed to if wandb is not installed and will only log metrics and media files to W&B if it is installed. To enable W&B logging, you just need to install the library using pip install wandb

  • Adds coco128.yaml

By default, the train.py script uses coco128.yaml for training but that file was missing from the data folder.

AyushExel avatar Dec 10 '20 19:12 AyushExel

Sorry, I want to know if there is the possibility to save the artifacts during the training, in order to resume the training from the last weights stored in wandb.ai. I ask this because in the Ultralytics YOLOv5, it can be done by specifying the followings flags: --upload_dataset --bbox_interval 1 --save_period 1 that are not expected in this version.

I'm working on Colab, so this is feature is really important to save the weights and don't lose the work.

antimo22 avatar Oct 04 '21 08:10 antimo22

@antimo22 hi. This version doesn't include the artifacts integration. But I can help you with that. Can't you just use yolov5 repo to train a yolov4 model? I think the author of this repo isn't interested in adding deeper integration.

AyushExel avatar Oct 04 '21 09:10 AyushExel

Hi @AyushExel, and thanks for your help. I tried to use a YOLOv4 model with the ultralytics implementation, but there are some differences in terms of formats (cfg vs yaml for the config files, and pt vs weights for the weights). Can I just use some consistent files, contained in other repo? Furthermore, I can't find the pt version of the weights file, there is some utility to convert it?

Sorry if I'm clogging up this pull request with my problems.

antimo22 avatar Oct 04 '21 10:10 antimo22

@antimo22 Sorry, I'm not sure if you can use .pt and .weights files interchangeably. Can't you just use a YOLOv5 model for training on your task? Or are you required to use yolov4 for some reason?

AyushExel avatar Oct 04 '21 13:10 AyushExel

@antimo22 hi. This version doesn't include the artifacts integration. But I can help you with that. Can't you just use yolov5 repo to train a yolov4 model? I think the author of this repo isn't interested in adding deeper integration.

Hello, the current version of wanddb integration is newer than this commit. But due to some annoying reasons, I think it is not suitable to update those functions in my repos. If you want to use new wandb functions in yolov5, you could integrate them with this repo by using loggers in yolov5 repo in 10 minutes.

WongKinYiu avatar Oct 04 '21 13:10 WongKinYiu

@WongKinYiu If you're interested, I can build the same integration for this repo.

AyushExel avatar Oct 04 '21 17:10 AyushExel

@antimo22 Sorry, I'm not sure if you can use .pt and .weights files interchangeably. Can't you just use a YOLOv5 model for training on your task? Or are you required to use yolov4 for some reason?

Yeah I have already used YOLOv5, but now I want to compare the perfomance with other small models. The problem is that, working with Colab, I can't work without the wandb artifacts.

antimo22 avatar Oct 05 '21 13:10 antimo22

@antimo22 I see. Let me know if there's any way I can help you.

AyushExel avatar Oct 06 '21 09:10 AyushExel

@antimo22 I see. Let me know if there's any way I can help you.

I'll try to integrate the new features of wandb in this repo, even though I don't have experience in this stuff. Thank you for your time!

antimo22 avatar Oct 11 '21 12:10 antimo22