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

What does the output mean when I convert to onnx? #112

Open
DungHD-1997 opened this issue Dec 8, 2023 · 5 comments
Open

What does the output mean when I convert to onnx? #112

DungHD-1997 opened this issue Dec 8, 2023 · 5 comments

Comments

@DungHD-1997
Copy link

I converted the file best_model.pth to onnx so that I can run onnx runtime on other platforms. But I still don't understand the meaning of the output when I view by netron . Can you explain it to me? Thank you!

image

@sovit-123
Copy link
Owner

Hi @DungHD-1997
The output is the key name that we provide when exporting the model. You will find this code in the export.py file.

dynamic_axes={
            'input' : {0 : 'batch_size'},
            'output' : {0 : 'batch_size'}
        }

And this is the entire export function.

torch.onnx.export(
        model,
        x,
        os.path.join(OUT_DIR, args['out']),
        export_params=True,
        opset_version=11,
        do_constant_folding=True,
        input_names=['input'],
        output_names = ['output'],
        dynamic_axes={
            'input' : {0 : 'batch_size'},
            'output' : {0 : 'batch_size'}
        }
    )

That's where the output comes from.

@DungHD-1997
Copy link
Author

thank you very much, i have successfully run onnx on c# . One question is how can I add the clases name into export .onnx model properties?

@sovit-123
Copy link
Owner

By default, I have not added that functionality. I will need to take a look at whether that's possible or not.

@DungHD-1997
Copy link
Author

If that's possible please inform me, thank you!

@sovit-123
Copy link
Owner

Sure.

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