Skip to content

dm_nfnet_f0 export to onnx, help #442

Closed

Description

@Splendon

Hi,

I trying to export dm_nfnet_f0 to onnx using gen-efficientnet-pytorch. But raise onnx operator is not be supported.
RuntimeError: Exporting the operator std_mean to ONNX opset version 11 is not supported. Please open a bug to request ONNX export support for the missing operator.
whet can I do to solve this problem, or is there another ways to convert pth.tar(dm_nfnet_f0) to onnx?
Thanks.

Traceback (most recent call last):
File "onnx_export.py", line 83, in
main()
File "onnx_export.py", line 60, in main
torch_out = torch.onnx._export(
File "/home/chenwh/anaconda3/lib/python3.8/site-packages/torch/onnx/init.py", line 28, in _export
result = utils._export(*args, **kwargs)
File "/home/chenwh/anaconda3/lib/python3.8/site-packages/torch/onnx/utils.py", line 632, in _export
_model_to_graph(model, args, verbose, input_names,
File "/home/chenwh/anaconda3/lib/python3.8/site-packages/torch/onnx/utils.py", line 417, in _model_to_graph
graph = _optimize_graph(graph, operator_export_type,
File "/home/chenwh/anaconda3/lib/python3.8/site-packages/torch/onnx/utils.py", line 203, in _optimize_graph
graph = torch._C._jit_pass_onnx(graph, operator_export_type)
File "/home/chenwh/anaconda3/lib/python3.8/site-packages/torch/onnx/init.py", line 263, in _run_symbolic_function
return utils._run_symbolic_function(*args, **kwargs)
File "/home/chenwh/anaconda3/lib/python3.8/site-packages/torch/onnx/utils.py", line 930, in _run_symbolic_function
symbolic_fn = _find_symbolic_in_registry(domain, op_name, opset_version, operator_export_type)
File "/home/chenwh/anaconda3/lib/python3.8/site-packages/torch/onnx/utils.py", line 888, in _find_symbolic_in_registry
return sym_registry.get_registered_op(op_name, domain, opset_version)
File "/home/chenwh/anaconda3/lib/python3.8/site-packages/torch/onnx/symbolic_registry.py", line 111, in get_registered_op
raise RuntimeError(msg)
RuntimeError: Exporting the operator std_mean to ONNX opset version 11 is not supported. Please open a bug to request ONNX export support for the missing operator.

Activity

  1. rwightman commented on Feb 19, 2021

    @rwightman
    Collaborator

    @Splendon if you google for it you'll find that op was only added to PyTorch recently and not in the last release. You have a few options

    • use a release candidate of PyTorch 1.8 or the nightly
    • changing the boolean use_layernorm to default to True might work, it hijacks the layer_norm kernel to do the mean/std and might be supported
    • you can re-write the layer to use separate mean + std ops
  2. ooodragon94 commented on Feb 23, 2021

    @ooodragon94

    @rwightman another question on "dm_nfnet_f0"
    using pip installed timm
    seems like there is no model defined on timm version 0.3.4

    is there something I am missing or maybe my system is outdated?

    thanks

  3. linhduongtuan commented on Feb 23, 2021

    @linhduongtuan
  4. linhduongtuan commented on Feb 23, 2021

    @linhduongtuan
  5. ooodragon94 commented on Feb 23, 2021

    @ooodragon94

    @linhduongtuan thank you very much!

  6. rwightman commented on Feb 23, 2021

    @rwightman
    Collaborator

    @linhduongtuan @ooodragon94 yes, I should add that git install command in the README. I tend to delay the official pip releases to give the master a bit of time to ensure bugs aren't found (and to allow me to re-run full model validation results.csv generation after adding new models, which takes multiple days now). A bunch of new updates coincided with all the NFNet activity. And my validation run keeps crashing the old test machine so it's taking a while :/

  7. ooodragon94 commented on Mar 5, 2021

    @ooodragon94

    @rwightman always appreciate your hard work. Thx a ton

  8. Splendon commented on Mar 15, 2021

    @Splendon
    Author

    @rwightman thank you very much for your suggestion, I'am trying these suggestion to deal with this operator.

  9. Splendon commented on Mar 15, 2021

    @Splendon
    Author

    @rwightman I have transformed nfnet from pth to onnx successfully, by using pytorch1.8.

  10. locked and limited conversation to collaborators on Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions