0

I want to log all training metrics to a csv file while it is training on YOLOV5 which is written with pytorch but the problem is that I don't want to use tensorboard.

To achieve this goal I tried some techniques like below:

-First log it into tensorboard and then try to convert it to a csv file (failed)

-Extract log files from Weights & Biases (failed)

-Write to a csv file directly during training (failed)

Here I tried opening a csv file and transforming tensor data into string but couldn't succeed.

So I really wonder how could I achieve this goal because YOLOV5 is not using pytorch utilites like model.fit which we can use callbacks with.

Thanks in advance.

kuti
  • 21
  • 3

2 Answers2

1

You might try using the Weights and Biases YOLOv5 integration. Here is the link: https://docs.wandb.ai/guides/integrations/yolov5

The link has more details, but here are some quotes that convey the basic idea:

Simply by installing wandb, you'll activate the built-in W&B logging features: system metrics, model metrics, and media logged to interactive Dashboards.

pip install wandb
git clone https://github.com/ultralytics/yolov5.git
python yolov5/train.py  # train a small network on a small dataset

Just follow the links printed to the standard out by wandb.pip install wandb git clone

You can also do model versioning & dataset visualization, which is explained more in the w&b yolov5 integration docs page (linked above). You can also watch this YouTube video for a guide: https://youtu.be/yyecuhBmLxE

Dylan
  • 63
  • 1
  • 4
  • 9
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Tyler2P Dec 17 '21 at 21:01
  • Thanks @Tyler2P, I added some details. – Dylan Dec 19 '21 at 18:21
0

If you train using YOLOv5's train.py, by default it will save results from each epoch to a results.csv file that can be found in yolov5/runs/train/your_training_run

This will look like:

epoch train/box_loss etc.
0 0.059996 ...
1 0.041033 ...

This uses the Weights and Biases Logging. Is there any particular reason you aren't using their logging? If you're still having issues with using their service, might be a good idea to trouble shoot that. YOLOv5 training with the Weights and Biases logging is very nice. Even if you don't use their online tools (which are awesome!) all the results, visuals, etc. will be saved locally for you.