-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Remove/raise exception when external file exists during onnx.save #6497
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
Conversation
Signed-off-by: Po-Chu Hsu <tonypottera@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6497 +/- ##
==========================================
- Coverage 57.40% 57.39% -0.01%
==========================================
Files 507 507
Lines 31526 31528 +2
Branches 3548 3549 +1
==========================================
Hits 18096 18096
- Misses 12582 12583 +1
- Partials 848 849 +1 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Po-Chu Hsu <tonypottera@gmail.com>
Should we remove it or raise an exception? cc @gramalingam |
I moved the check to |
Signed-off-by: Po-Chu Hsu <tonypottera@gmail.com>
Signed-off-by: Po-Chu Hsu <tonypottera@gmail.com>
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks. Please ignore my previous comments
Could you add the |
Overwriting can be unsafe if the model proto has reference to the existing data file. Maybe we can provide an option? But I also don't prefer overcrowding the options we have. hmm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deferring to @gramalingam
Thank you @justinchuby, I added the explanations. |
@gramalingam any thoughts? |
I think it is safer not to overwrite it silently. I am fine with using a user option to overwrite or leaving in the PR's current form (with an exception). |
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Description
Raise an exception when the external file exists during
onnx.save
.Note: we can also consider to overwrite it.
Motivation and Context
If the external file is not removed, it will not be overwritten. The new content is always appended to it, making it larger and larger forever.