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?
1 Answer
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.
-
getting error as follows:
ERROR: Could not build wheels for mysqlclient, which is required to install pyproject.toml-based projects
Commented Feb 9 at 8:01 -
Sorry, this is super old and Pytorch YOLOv4 isn't maintained anymore :(– StanleyCommented Feb 28 at 18:31