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

IF weight download fails, bad file persists. #42

Open
HastingsGreer opened this issue Jul 21, 2022 · 2 comments
Open

IF weight download fails, bad file persists. #42

HastingsGreer opened this issue Jul 21, 2022 · 2 comments

Comments

@HastingsGreer
Copy link
Collaborator

No description provided.

@HastingsGreer
Copy link
Collaborator Author

@PranjalSahu suggests

for i in range(5):
        if os.path.exists('pretrained_OAI_model'):
            import hashlib
            h = hashlib.md5(open('pretrained_OAI_model', 'rb').read()).hexdigest()
            if h == '414e4b5da9f62a4ab3635791b52cbdfc':
                return h
            else:
                urllib.request.urlretrieve(
                    "https://github.com/HastingsGreer/InverseConsistency/releases/download/pretrained_oai_model/knee_aligner_resi_net99900",
            "pretrained_OAI_model")

@HastingsGreer
Copy link
Collaborator Author

matt recommends pooch for downloading with hash check

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

1 participant