Reputation: 1
I was trying out the yolov4 from https://github.com/theAIGuysCode/YOLOv4-Cloud-Tutorial and I wanted to convert the weights from .wt files to .pt files for pytorch Is there a way I can do that?
Upvotes: 0
Views: 7592
Reputation: 839
Pytorch YOLOv4 (I am biased as I am a maintainer) has the ability to do this with darknet2pytorch
. The following is an example snippet
from tool.darknet2pytorch import Darknet
WEIGHTS = Darknet(cfgfile)
WEIGHTS.load_weights(weightfile)
Where cfgfile
is your darknet config.cfg
file, and weightfile
is your darknet .wt
weights.
WEIGHTS
is now an ordinary PyTorch model, which you can save however you'd like.
Upvotes: 2