brocolli
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
Show your support
Give a 🌟 if this project helpes~
Metadata
Release files for brocolli 4.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| brocolli-4.0.2.tar.gz | 60.6 kB | Without provenance | Details for brocolli-4.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| brocolli-4.0.2-py3-none-any.whl | Python 3 | none | any | Details for brocolli-4.0.2-py3-none-any.whl |
Total release size: 178.7 kB
Release files / brocolli-4.0.2.tar.gz
| Download URL | brocolli-4.0.2.tar.gz |
|---|---|
| Size | 60.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
16b2ff08f44b4322e58437bb074b44b89dc41e9061596c129afd46c48012006b
|
|
BLAKE2b-256 checksum How to use checksums |
1928798faeeae85d69f932c928de59e8fc6386266913d76072a38d2a7a7aab34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / brocolli-4.0.2-py3-none-any.whl
| Download URL | brocolli-4.0.2-py3-none-any.whl |
|---|---|
| Size | 118.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85830e117d5c4c3791df8e06abd39c0bfd710028b610f5e541c203c041c91fa4
|
|
BLAKE2b-256 checksum How to use checksums |
33b3b002dce57ba18c8c86c80f652ad36b834cdf10709b80365f4e2c407ea5f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Security for brocolli 4.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.