0

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 1

2

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.

2
  • 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 :(
    – Stanley
    Commented Feb 28 at 18:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.