-
Notifications
You must be signed in to change notification settings - Fork 214
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
Export to ONNX Error #10
Comments
Full traceback :
|
As per the little comment in the README, you currently need to set the exportable flag to True (int he latest version it's here) https://github.com/rwightman/gen-efficientnet-pytorch/blob/master/geffnet/exportable.py ... The memory-efficient autograd FN for swish, and the default padded same convolutions for the TF variant models don't export properly Although... the MobileNetV3 model uses neither of those so it should have worked and looked like it would have aside from the segmentation fault. I just ran it from the master with no crashes/issues. Are you using a fairly new version of PyTorch 1.2+? My ONNX version is 1.5. |
@ivder It looks like the opposite of what I expected, PyTorch/ONNX being too new. I get the same segfault with PyTorch 1.3 + ONNX 1.6 installed. I get a different crash with PyTorch 1.3 + ONNX 1.5 installed. It works with PyTorch 1.2 + ONNX 1.5 Some related issues: |
@rwightman Thanks for clarifying this issue. I used the latest onnx and pytorch, after downgraded both of them I manage to export the model to ONNX. Another thing that I want to confirm, the exported onnx is using caffe2 as backend right? Can I use the onnx model in another framework such as TensorFlow, Caffee, TensorRT for inference? Thanks for the help |
@ivder Good to hear. You should be able to use the models with any ONNX runtime or conversion tool (https://github.com/microsoft/onnxruntime, https://github.com/onnx/onnx-tensorrt, etc) that supports the same file format and operator versions as you export in. Caffe2 is just the default available runtime if you have PyTorch installed. |
Hi, thanks for the great work. Following my question here , I tried to convert to ONNX using this repo. But I got several errors.
By inputting this command just like your example, I got segmentation fault error :
When I tried with efficientnet_b0 using checkpoint and not using checkpoint
sudo python3 onnx_export.py --model efficientnet_b0 ./efficientnet.onnx
or
sudo python3 onnx_export.py --model efficientnet_b0 --checkpoint ../train/model_best.pth.tar --num-classes 30 ./efficientnet.onnx
I got
Couldn't export Python operator SwishAutoFn
error.Any help would be appreciated, thanks
The text was updated successfully, but these errors were encountered: