Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: Exporting the operator hardswish to ONNX opset version 11 is not supported. Please open a bug to request ONNX export support for the missing operator. #44

Open
ll553664391 opened this issue Nov 2, 2020 · 1 comment

Comments

@ll553664391
Copy link

Can you help me solve this problem

RuntimeError: Exporting the operator hardswish to ONNX opset version 11 is not supported. Please open a bug to request ONNX export support for the missing operator.

@linsongxue
Copy link

linsongxue commented Nov 30, 2020

Use custom-defined Hardswish instead of the nn.Hardswish. You can find the Hardswish function in yolov5/utils/activations.py, and then, before exporting into onnx model, plz insert this code for k, m in model.named_modules(): m._non_persistent_buffers_set = set() if isinstance(m, models.common.Conv) and isinstance(m.act, nn.Hardswish): m.act = Hardswish()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants