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

Change the cached model checking logic #545

Merged
merged 2 commits into from Feb 22, 2018
Merged

Conversation

houseroad
Copy link
Member

Since we change the file extension from .pb to .onnx, we should not keep the old cached files.

if not os.path.exists(model_dir):
if not os.path.exists(os.path.join(model_dir, 'model.onnx')):
if os.path.exists(model_dir):
shutil.rmtree(model_dir)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to not delete user's files, move it to say ~/.onnx/models/squeezenet.old.1 (or .2 if .1 already exists)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now move it as .old.0, old.1, etc...

@houseroad houseroad merged commit bb61223 into onnx:master Feb 22, 2018
Ac2zoom pushed a commit to Ac2zoom/onnx that referenced this pull request Jun 21, 2018
* Change the cached model checking logic

* Move the old folder, instead of deleting
jcwchen pushed a commit to jcwchen/onnx that referenced this pull request Sep 23, 2020
* Change the cached model checking logic

* Move the old folder, instead of deleting
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

Successfully merging this pull request may close these issues.

None yet

4 participants