Skip to content
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

[feature request] support exporting the model to ONNX format #1550

Open
opringle opened this issue Dec 3, 2023 · 2 comments
Open

[feature request] support exporting the model to ONNX format #1550

opringle opened this issue Dec 3, 2023 · 2 comments

Comments

@opringle
Copy link

opringle commented Dec 3, 2023

Currently attempting to export a model that uses KeyedJaggedTensor to ONNX format results in the following error:

gm = symbolic_trace(model)
scripted_gm: torch.jit.ScriptModule | torch.jit.ScriptFunction = torch.jit.script(gm)  # type: ignore

torch.onnx.export(
    model=scripted_gm,
    args=...,
    f="model.onnx",
    export_params=True,
    verbose=True,
    opset_version=10,
    do_constant_folding=True,
    input_names=["input"],
    output_names=["output"],
    dynamic_axes={
        "input": {0: "batch_size"},
        "output": {0: "batch_size"},
    },
)
RuntimeError: Only tuples, lists and Variables are supported as JIT inputs/outputs. Dictionaries and strings are also accepted, but their usage is not recommended. Here, received an input of unsupported type: KeyedJaggedTensor
@henrylhtsang
Copy link
Contributor

Linking related issue:
#1221

@opringle
Copy link
Author

opringle commented Dec 7, 2023

Is this a feature request we should make to the onnx team or torchrec team?

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

No branches or pull requests

2 participants