Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

inisis/brocolli

Repository files navigation

brocolli (Deprecated, this repo is no longer maintained)

torch fx based pytorch model converter, including pytorch2caffe, pytorch2onnx.
torch fx based pytorch model quantizier.

Installation

pip install brocolli

How to use

  • torch2caffe

    • caffe installation
    pip install brocolli-caffe
    import torchvision.models as models
    from brocolli.converter.pytorch_caffe_parser import PytorchCaffeParser
    net = models.alexnet(pretrained=False)
    x = torch.rand(1, 3, 224, 224)
    pytorch_parser = PytorchCaffeParser(net, x)
    pytorch_parser.convert()
    pytorch_parser.save('alexnet')
    

    run this script until you see "accuracy test passed" on screen, then you can get alexnet.caffemodel and alexnet.prototxt under under current folder.

  • torch2onnx

    import torchvision.models as models
    from brocolli.converter.pytorch_onnx_parser import PytorchOnnxParser
    net = models.alexnet(pretrained=False)
    x = torch.rand(1, 3, 224, 224)
    pytorch_parser = PytorchOnnxParser(net, x)
    pytorch_parser.convert()
    pytorch_parser.save('alexnet.onnx')
    

    run this script until you see "accuracy test passed" on screen, then you can get alexnet.onnx under current folder.

Contact

QQ Group: 597059928

image

Show your support

Give a 🌟 if this project helpes~

About

Everything in Torch Fx

Topics

Resources

License

Stars

Watchers

Forks

Packages

Contributors

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /