candle icon indicating copy to clipboard operation
candle copied to clipboard

How to train my own YOLOv8 model?

Open mzdk100 opened this issue 1 year ago • 5 comments

Candle provides an example of YOLOv8, which is very useful to use. But I don't know how to train on my own dataset? Can handle directly load the model trained by pytorch?

mzdk100 avatar Feb 13 '24 01:02 mzdk100

Perhaps you could check out https://github.com/KGrewal1/optimisers? There is a training example, and loading safetensors and other formats from saved Pytorch checkpoints could easily be added. For example, see this snippet where I load the weights from downloaded safetensors.

To train on your own dataset, you could look try to load your own data or use candle_datasets. Ultimately, it comes down to converting your data into tensors: tokenization or image processing is part of the process. If you have any questions, please feel free to ask!

EricLBuehler avatar Feb 13 '24 02:02 EricLBuehler

Thank you for your reply. Training with Candle is a bit difficult for me. I may choose to train YOLOv8 on PyTorch, then convert the checkpoint of PT to safetensors format, and load safetensors on Rust for inference.

mzdk100 avatar Feb 13 '24 03:02 mzdk100

@mzdk100 Did you succeed in the end?
----“I may choose to train YOLOv8 on PyTorch, then convert the checkpoint of PT to safetensors format, and load safetensors on Rust for inference.”

chenkuokuo avatar Mar 18 '24 12:03 chenkuokuo

I haven't started trying yet.

mzdk100 avatar Mar 18 '24 13:03 mzdk100

Thank you for your reply

chenkuokuo avatar Mar 18 '24 13:03 chenkuokuo