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

Loading models from the checkpoint leads to package version conflicts #28

Open
MuhammedHasan opened this issue Jul 19, 2024 · 0 comments
Assignees

Comments

@MuhammedHasan
Copy link
Contributor

I downloaded grelu from the github and try to load the borzoi model

from grelu.resources import load_model
fold=0
borzoi = load_model(project="borzoi", model_name=f"human_state_dict_fold{fold}")

The loading of the model the checkpoint leads to error below:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[28], [line 2](vscode-notebook-cell:?execution_count=28&line=2)
      [1](vscode-notebook-cell:?execution_count=28&line=1) fold=0
----> [2](vscode-notebook-cell:?execution_count=28&line=2) borzoi = load_model(project="borzoi", model_name=f"human_state_dict_fold{fold}")

File ~/Projects/gReLU/src/grelu/resources/__init__.py:136, in load_model(project, model_name, alias, checkpoint_file)
    [134](https://vscode-remote+ssh-002dremote-002brosalind.vscode-resource.vscode-cdn.net/gstore/home/celikm5/Projects/borzoi-variant-effect-pred/.snakemake/scripts/~/Projects/gReLU/src/grelu/resources/__init__.py:134) with TemporaryDirectory() as d:
    [135](https://vscode-remote+ssh-002dremote-002brosalind.vscode-resource.vscode-cdn.net/gstore/home/celikm5/Projects/borzoi-variant-effect-pred/.snakemake/scripts/~/Projects/gReLU/src/grelu/resources/__init__.py:135)     art.download(d)
--> [136](https://vscode-remote+ssh-002dremote-002brosalind.vscode-resource.vscode-cdn.net/gstore/home/celikm5/Projects/borzoi-variant-effect-pred/.snakemake/scripts/~/Projects/gReLU/src/grelu/resources/__init__.py:136)     model = LightningModel.load_from_checkpoint(Path(d) / checkpoint_file)
    [138](https://vscode-remote+ssh-002dremote-002brosalind.vscode-resource.vscode-cdn.net/gstore/home/celikm5/Projects/borzoi-variant-effect-pred/.snakemake/scripts/~/Projects/gReLU/src/grelu/resources/__init__.py:138) return model
    
AttributeError: module 'pytorch_lightning' has no attribute 'utilities'

Problem is due to version difference of pytorch_lightning.

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