YoloSharp icon indicating copy to clipboard operation
YoloSharp copied to clipboard

能开发加载原生pt格式和训练生成原生pt格式么?

Open jinfengbyd opened this issue 11 months ago • 4 comments

jinfengbyd avatar Dec 15 '25 01:12 jinfengbyd

The .pt of ultralytics is different from other .pt weight, it contains many infos about the model. I've tried to load it, but not work well. So I have convert it to .safetensors and load the weight only.

IntptrMax avatar Dec 19 '25 12:12 IntptrMax

.bin格式是自定义的格式吗?怎么把.pt转换成这个呢

LBW6230 avatar Jan 09 '26 09:01 LBW6230

.bin is created from torchsharp, it is a Binary file. You can save the .pt weight to .safetensor file or .pt file with state_dict only in python, and load it with YoloSharp.ModelLoader.SafetensorsLoader or YoloSharp.ModelLoader.PickleLoader. Then yolo can load it like the method blow.

The pre-trained .bin weight in yolosharp is from yolo .pt, the weights are same.

Image

IntptrMax avatar Jan 11 '26 10:01 IntptrMax

YoloSharp can load .pt weight file now.

IntptrMax avatar Oct 13 '26 15:10 IntptrMax