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

Automatically download model weights #68

Merged
merged 47 commits into from
Nov 3, 2022
Merged
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
21e7487
Download model weights from GitHub release
bittremieux Aug 23, 2022
a6467ee
Include dependencies
bittremieux Aug 23, 2022
2949861
Update model usage documentation
bittremieux Aug 23, 2022
7408805
Reformat with black
bittremieux Aug 23, 2022
1c7b1bd
Download weights to the OS-specific app dir
bittremieux Aug 24, 2022
325d050
Don't download weights if already in cache dir
bittremieux Aug 24, 2022
2880967
Update model file instructions
bittremieux Aug 24, 2022
d5e0244
Remove release notes from the README
bittremieux Aug 24, 2022
6d2aa38
Remove explicit model specification from example commands
bittremieux Aug 24, 2022
1692936
Harmonize default parameters and config values
bittremieux Aug 24, 2022
a14f785
No need to specify config file by default
bittremieux Aug 24, 2022
84ea01a
Merge pull request #69 from Noble-Lab/config
bittremieux Aug 27, 2022
1688d68
Simplify version matching regex
bittremieux Sep 9, 2022
904c7fd
Remove depthcharge related tests
bittremieux Sep 9, 2022
96e8c24
Make sure that package data is included
bittremieux Sep 9, 2022
681986f
Merge remote-tracking branch 'origin/main' into weights
bittremieux Sep 9, 2022
965a04a
Remove obsolote (ppx) tests
bittremieux Sep 9, 2022
29a0c36
Update integration test
bittremieux Sep 9, 2022
745b0ce
Resolve merge conflicts
wfondrie Oct 11, 2022
aa7f47f
Add MacOS support and support for Apple's MPS chips
wfondrie Oct 11, 2022
5292da9
Fail test but print version
wfondrie Oct 11, 2022
cd59657
Added n_worker fn and tests
wfondrie Oct 11, 2022
93b53d8
Create split_version fn and add unit tests
wfondrie Oct 11, 2022
f0eba58
Fix debugging unit test
wfondrie Oct 11, 2022
31f5b17
Explicitly set version
wfondrie Oct 11, 2022
27838b8
Monkeypatch loaded version
wfondrie Oct 11, 2022
ea02de0
Add device selector, so that on CPU-only runs the devices > 0
wfondrie Oct 11, 2022
9e03cc9
Add windows patch
wfondrie Oct 25, 2022
b055e6d
Fix typo
wfondrie Oct 26, 2022
a3645fd
Revert
wfondrie Oct 26, 2022
2bb3a55
Use main process for data loading on Windows
wfondrie Oct 26, 2022
683ebbb
Fix typo
wfondrie Oct 26, 2022
c275127
Fix unit test
wfondrie Oct 26, 2022
7057600
Fix devices for when num_workers == 0
wfondrie Oct 26, 2022
58e4ce1
Fix devices for when num_workers == 0
wfondrie Oct 26, 2022
7115c2d
Minor README updates
bittremieux Nov 2, 2022
22ce3bf
Import reordering
bittremieux Nov 2, 2022
8f00696
Minor code and docstring reformatting
bittremieux Nov 2, 2022
af407fa
Test model weights retrieval
bittremieux Nov 2, 2022
98f242d
Merge remote-tracking branch 'origin/main' into weights
bittremieux Nov 2, 2022
767acd4
Fix getting the number of devices
bittremieux Nov 2, 2022
1e8c655
Disable excessive Tensorboard deprecation warnings
bittremieux Nov 2, 2022
e922b76
Don't use worker threads on MacOS
bittremieux Nov 2, 2022
b7188d6
Warnings need to be ignored before import
bittremieux Nov 2, 2022
e7f7df6
Additional weights tests
bittremieux Nov 2, 2022
d6fc99b
Disable tests on MacOS
bittremieux Nov 3, 2022
aec590a
Include Python 3.10 as supported version
bittremieux Nov 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Minor README updates
  • Loading branch information
bittremieux committed Nov 2, 2022
commit 7115c2d1f90f7c6804a93b72299cdc364cc83088
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@ See [`casanovo/config.yaml`](https://github.com/Noble-Lab/casanovo/blob/main/cas
When running Casanovo in `denovo` or `eval` mode, Casanovo needs compatible pretrained model weights to make predictions.
Model weights can be found on the [Releases page](https://github.com/Noble-Lab/casanovo/releases) under the "Assets" for each release (file extension: .ckpt).
The model file can then be specified using the `--model` command-line parameter when executing Casanovo.
To assist users, if no model file is specified Casanovo will try to download and use compatible a model file automatically.
To assist users, if no model file is specified Casanovo will try to download and use a compatible model file automatically.

Not all releases might have a model file included on the [Releases page](https://github.com/Noble-Lab/casanovo/releases), in which case model weights for alternative releases with the same major version number can be used.

@@ -109,7 +109,7 @@ The example MGF file is available at [`sample_data/sample_preprocessed_spectra.m
casanovo --mode=denovo --peak_path=[PATH_TO]/sample_preprocessed_spectra.mgf
```

Note: If you want to get the output mzTab file in different location than the working directory, specify an alternative output location using the `--output` parameter.
Note: If you want to store the output mzTab file in a different location than the current working directory, specify an alternative output location using the `--output` parameter.

This job will take very little time to run (< 1 minute).

@@ -140,7 +140,6 @@ You can find the `config.yaml` configuration file that is used by default [here]
This means that there was not enough (free) memory available on your GPU to run Casanovo, which is especially likely to happen when you are using a smaller, consumer-grade GPU.
We recommend trying to decrease the `train_batch_size` or `predict_batch_size` options in the [config file](https://github.com/Noble-Lab/casanovo/blob/main/casanovo/config.yaml) (depending on whether the error occurred during `train` or `denovo` mode) to reduce the number of spectra that are processed simultaneously.
Additionally, we recommend shutting down any other processes that may be running on the GPU, so that Casanovo can exclusively use the GPU.
<<<<<<< HEAD

**How do I solve a "PermissionError: GitHub API rate limit exceeded" error when trying to run Casanovo?**

@@ -150,13 +149,12 @@ However, the GitHub API is limited to maximum 60 requests per hour per IP addres
Consequently, if Casanovo has been executed multiple times already, it might temporarily not be able to communicate with GitHub.
You can avoid this error by explicitly specifying the model file using the `--model` parameter.

**I see "NotImplementedError: The operator 'aten::index.Tensor'..." when using a Mac with an Apple Silicon chip**
**I see "NotImplementedError: The operator 'aten::index.Tensor'..." when using a Mac with an Apple Silicon chip.**

Casanovo can leverage the Apples Metal Performance Shaders (MPS) on newer Mac computers, requires that the `PYTORCH_ENABLE_MPS_FALLBACK` be set to `1`:
Casanovo can leverage Apple's Metal Performance Shaders (MPS) on newer Mac computers, which requires that the `PYTORCH_ENABLE_MPS_FALLBACK` is set to `1`:

``` sh
export PYTORCH_ENABLE_MPS_FALLBACK=1
```
This will need to be set with each new shell session, or you can add it to your `.bashrc` / `.zshrc` to set this environment variable by default.
``` sh
export PYTORCH_ENABLE_MPS_FALLBACK=1
```

This will need to be set with each new shell session, or you can add it to your `.bashrc` / `.zshrc` to set this environment variable by default.