Can not use torch.jit.script to export model
See original GitHub issuetorch.jit.frontend.NotSupportedError: Compiled functions can’t take variable number of arguments or use keyword-only arguments with defaults: at /usr/local/lib/python3.7/dist-packages/torch/autograd/function.py:26:25 def mark_dirty(self, *args): ~~~~~ <— HERE r"""Marks given tensors as modified in an in-place operation.
**This should be called at most once, only from inside the**
:func:`forward` **method, and all arguments should be inputs.**
Every tensor that's been modified in-place in a call to :func:`forward`
should be given to this function, to ensure correctness of our checks.
It doesn't matter whether the function is called before or after
modification.
‘SwishImplementation’ is being compiled since it was called from ‘torch.efficientnet_pytorch.utils.MemoryEfficientSwish.forward’
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:10
Top Results From Across the Web
TorchScript — PyTorch 1.13 documentation
This makes it possible to train models in PyTorch using familiar tools in Python and then export the model via TorchScript to a...
Read more >Export to TorchScript - Hugging Face
TorchScript does not allow you to export models that have tied weights, so it is necessary to untie and clone the weights beforehand....
Read more >Using TorchScript to serialize and deploy model
Models in TorchANI's model zoo support TorchScript. TorchScript is a way to create serializable and optimizable models from PyTorch code. It allows users...
Read more >Google Universal Image Embedding | Kaggle
I have a pre-trained model that uses efficientnet as backbone, and I cant export it with torch.jit.script issue, but torch.jit.trace worked. So I...
Read more >How to convert your PyTorch model to TorchScript | djl
This works best when your model doesn't have control flow. If you do have control ... In DJL, we use tracing to create...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It seems, that you need to make
model.set_swish(False)
before exporting the model.But what is jit.script is needed? For instance for jit.trace after quantization isn’t working