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: ONNX export failed: Couldn't export Python operator SwishImplementation #6

Open
nutsam opened this issue May 13, 2020 · 7 comments

Comments

@nutsam
Copy link

nutsam commented May 13, 2020

I ran your convert to onnx code and had error like title, can you help?

@murdockhou
Copy link
Owner

murdockhou commented May 14, 2020

@nutsam you need set EfficientSwish false like that

@nutsam
Copy link
Author

nutsam commented May 14, 2020

Yes, I used your code and has that line already,
but still error.

@murdockhou
Copy link
Owner

murdockhou commented May 14, 2020 via email

@Beam-wi
Copy link

Beam-wi commented May 28, 2020

@nutsam Have you solved this problem? I encounter the same problem with you.

@Beam-wi
Copy link

Beam-wi commented May 28, 2020

@nutsam 知道了,作者在 EfficientDetBackbone 中实例化 BiFPN,Regressor,Classifier时没有传onnx_export参数,加进去就行了

@swchew
Copy link

swchew commented Aug 12, 2020

@Beam-wi may I ask which code and exactly where should we insert "onnx_export" into?

@heitorrapela
Copy link

If you print the model (print(model)), you can debug in which parts of the code still have the MemoryEfficientSwish.

In my case, my model had the backbone (efficient net) and the detector wrapped, so when I loaded the set_swish after the loaded model or if I used the flag to initialize the model and then load the weights, flag onnx_export didn't update the layer. So, I had to fix it manually as the following code:

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

5 participants