Skip to content

Conversation

tigert1998
Copy link
Contributor

No description provided.

@tigert1998
Copy link
Contributor Author

tigert1998 commented Nov 18, 2020

There's a series of jit activation functions but I only changed one of them. I am here to kindly remind you that simply adding a symbolic function can support exporting to onnx format and make it easy for edge deployment.

@rwightman
Copy link
Collaborator

@tigert1998 thanks for pointing that out, will keep it in mind... there are reasons besides onnx export to not use the AutoGrad + Jit version, the activation factory allows switching between different variants of those activations, including ones that are onnx exportable. Now that SiLU is in PyTorch (as of 1.7) it's moot for swish.

@tigert1998
Copy link
Contributor Author

But I also suggest adding this workaround since not everyone can use torch 1.7+. In my case, I have to share GPUs with my colleagues. The servers use cuda 10.1 and people use torch 1.6. I am not the administrator so I do not have permission to update cuda version.
I think adding the symbolic workaround with a warning might be a not-so-bad choice.

@rwightman
Copy link
Collaborator

rwightman commented Nov 19, 2020

@tigert1998 you're aware you can create the model with create_model('efficientnet_b0', exportable=True) ? As mentioned, there are other reasons besides onnx exporting that might need to avoid the autograd.Function or jit completely

@tigert1998 tigert1998 closed this Nov 21, 2020
@rwightman rwightman reopened this Feb 4, 2021
@rwightman rwightman merged commit b9843f9 into huggingface:master Feb 4, 2021
guoriyue pushed a commit to guoriyue/pytorch-image-models that referenced this pull request May 24, 2024
Add symbolic for SwishJitAutoFn to support onnx
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

Successfully merging this pull request may close these issues.

2 participants