Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.8k
-
I am trying to jit trace the unet model. But I get an error saying "Could not export Python function call 'SwishImplementation'. Remove calls to python functions before export." How can I export the model so I can use it in a c++ application. model = smp.Unet('efficientnet-b7') input = torch.randn((1,3,224,224)) model = torch.jit.trace(model,input) model.save('model.pt') |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 2 comments 3 replies
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Just call before tracing |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Hi, Thanks that fixed the issue. But im unable to load the model.pt file in c++ using torch::jit::load(). Also how can I export the model to a onnx format? I Keep getting warning saying "Constant folding- only steps=1 can be folded for opset >=10" |
BetaWas this translation helpful?Give feedback.
All reactions
-
I had an issue with this case as well. tho after using Just call before tracing model.encoder.set_swish(memory_efficient=False). I got this Any suggestions? |
BetaWas this translation helpful?Give feedback.
All reactions
-
The model is checking that the input size is divisible by 32 or 16 to give a proper error. In the case of tracing it should be fine, but shape-checking will not work in the traced model. |
BetaWas this translation helpful?Give feedback.
All reactions
-
I see. Thank you |
BetaWas this translation helpful?Give feedback.