Fix ONNX file name to avoid .pt.onnx#615
Open
Vicrrs wants to merge 1 commit intomarcoslucianops:masterfrom
Open
Fix ONNX file name to avoid .pt.onnx#615Vicrrs wants to merge 1 commit intomarcoslucianops:masterfrom
Vicrrs wants to merge 1 commit intomarcoslucianops:masterfrom
Conversation
jyrainer
reviewed
May 30, 2025
|
|
||
| onnx_input_im = torch.zeros(args.batch, 3, *img_size).to(device) | ||
| onnx_output_file = f'{args.weights}.onnx' | ||
| onnx_output_file = args.weights.replace(".pt", "") + ".onnx" |
There was a problem hiding this comment.
I think args.weights.replace(".pt", ".onnx") is more better
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, the script generates files with the name
best.pt.onnxwhen exporting a YOLOv8 model to ONNX.This can cause problems integrating with other systems.
I changed the filename generation to remove the
.ptextension, ensuring the result isbest.onnxinstead ofbest.pt.onnx.Example of command that causes the problem: