Noble-Lab / cascadia

Transformer deep learning model for de novo sequencing of data-independent acquisition mass spectrometry data
Apache License 2.0
6 stars 3 forks source link

Error when running the example #3

Open aukeheerdink opened 1 week ago

aukeheerdink commented 1 week ago

When following the Getting Started guide, I ran into an issue when running the example mzml file.

The command I used was: cascadia --mode sequence --t demo.mzML --checkpoint cascadia_pretrained.ckpt --out demo_results And this gave me the following error:

Augmenting spectra from: demo.mzML
Generating 16485 augmented spectra
/home/xxxx/xxxx/cascadia_11-13-14:45:45/temp.asf: 2629878lines [00:13, 201722.96lines/s]
Read parser
Writing h5py
Written file
Running inference on augmented spectra from: demo.mzML
GPU found
GPU available: True (cuda), used: True
TPU available: False, using: 0 TPU cores
IPU available: False, using: 0 IPUs
HPU available: False, using: 0 HPUs
/home/xxxx/xxxx/envs/cascadia_v0.1/lib/python3.10/site-packages/pytorch_lightning/trainer/connectors/logger_connector/logger_connector.py:67: UserWarning: Starting from v1.9.0, `tensorboardX` has been removed as a dependency of the `pytorch_lightning` package, due to potential conflicts with other packages in the ML ecosystem. For this reason, `logger=True` will use `CSVLogger` as the default logger, unless the `tensorboard` or `tensorboardX` packages are found. Please `pip install lightning[extra]` or one of them to enable TensorBoard support by default
  warning_cache.warn(
Traceback (most recent call last):
  File "/home/xxxx/xxxx/envs/cascadia_v0.1/bin/cascadia", line 8, in <module>
    sys.exit(main())
  File "/home/xxxx/xxxx/envs/cascadia_v0.1/lib/python3.10/site-packages/cascadia/cascadia.py", line 206, in main
    preds = trainer.predict(model, dataloaders=train_loader)
  File "/home/xxxx/xxxx/envs/cascadia_v0.1/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 892, in predict
    return call._call_and_handle_interrupt(
  File "/home/xxxx/xxxx/envs/cascadia_v0.1/lib/python3.10/site-packages/pytorch_lightning/trainer/call.py", line 36, in _call_and_handle_interrupt
    return trainer.strategy.launcher.launch(trainer_fn, *args, trainer=trainer, **kwargs)
  File "/home/xxxx/xxxx/envs/cascadia_v0.1/lib/python3.10/site-packages/pytorch_lightning/strategies/launchers/multiprocessing.py", line 113, in launch
    mp.start_processes(
  File "/home/xxxx/xxxx/envs/cascadia_v0.1/lib/python3.10/site-packages/torch/multiprocessing/spawn.py", line 188, in start_processes
    process.start()
  File "/home/xxxx/xxxx/envs/cascadia_v0.1/lib/python3.10/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/home/xxxx/xxxx/envs/cascadia_v0.1/lib/python3.10/multiprocessing/context.py", line 288, in _Popen
    return Popen(process_obj)
  File "/home/xxxx/xxxx/envs/cascadia_v0.1/lib/python3.10/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/home/xxxx/xxxx/envs/cascadia_v0.1/lib/python3.10/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/home/xxxx/xxxx/envs/cascadia_v0.1/lib/python3.10/multiprocessing/popen_spawn_posix.py", line 47, in _launch
    reduction.dump(process_obj, fp)
  File "/home/xxxx/xxxx/envs/cascadia_v0.1/lib/python3.10/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
TypeError: cannot pickle '_nrt_python._MemInfo' object
justin-a-sanders commented 4 days ago

This issue usually arises when the model checkpoint file was produced with an incompatible version of pytorch or one of it's dependencies. Can you share a list of the versions of all the packages in your environment (the output of conda list) so I can try and track down the inconsistency?

We recently made a number of changes to cascadia and released an update to pip, so it's possible that a fresh pip install into a clean environment might resolve the issue for you.

aukeheerdink commented 14 hours ago

This is the output of conda list:

# packages in environment at /home/xxxx/xxxx/envs/cascadia_v0.4:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main
_openmp_mutex             5.1                       1_gnu
absl-py                   2.1.0                    pypi_0    pypi
aiohappyeyeballs          2.4.3                    pypi_0    pypi
aiohttp                   3.11.7                   pypi_0    pypi
aiosignal                 1.3.1                    pypi_0    pypi
annotated-types           0.7.0                    pypi_0    pypi
anyio                     4.6.2.post1              pypi_0    pypi
appdirs                   1.4.4                    pypi_0    pypi
arrow                     1.3.0                    pypi_0    pypi
async-timeout             5.0.1                    pypi_0    pypi
attrs                     24.2.0                   pypi_0    pypi
backoff                   2.2.1                    pypi_0    pypi
beautifulsoup4            4.12.3                   pypi_0    pypi
blessed                   1.20.0                   pypi_0    pypi
boto3                     1.35.68                  pypi_0    pypi
botocore                  1.35.68                  pypi_0    pypi
bzip2                     1.0.8                h5eee18b_6
ca-certificates           2024.9.24            h06a4308_0
cascadia                  0.0.4                    pypi_0    pypi
certifi                   2024.8.30                pypi_0    pypi
charset-normalizer        3.4.0                    pypi_0    pypi
click                     8.1.7                    pypi_0    pypi
cmake                     3.31.1                   pypi_0    pypi
contourpy                 1.3.1                    pypi_0    pypi
croniter                  1.4.1                    pypi_0    pypi
cycler                    0.12.1                   pypi_0    pypi
dateutils                 0.6.12                   pypi_0    pypi
deepdiff                  7.0.1                    pypi_0    pypi
dill                      0.3.9                    pypi_0    pypi
editor                    1.6.6                    pypi_0    pypi
einops                    0.8.0                    pypi_0    pypi
exceptiongroup            1.2.2                    pypi_0    pypi
fastapi                   0.115.5                  pypi_0    pypi
fastobo                   0.12.3                   pypi_0    pypi
filelock                  3.16.1                   pypi_0    pypi
fonttools                 4.55.0                   pypi_0    pypi
frozenlist                1.5.0                    pypi_0    pypi
fsspec                    2024.10.0                pypi_0    pypi
grpcio                    1.68.0                   pypi_0    pypi
h11                       0.14.0                   pypi_0    pypi
h5py                      3.12.1                   pypi_0    pypi
idna                      3.10                     pypi_0    pypi
inquirer                  3.4.0                    pypi_0    pypi
itsdangerous              2.2.0                    pypi_0    pypi
jinja2                    3.1.4                    pypi_0    pypi
jmespath                  1.0.1                    pypi_0    pypi
kiwisolver                1.4.7                    pypi_0    pypi
lark                      1.2.2                    pypi_0    pypi
ld_impl_linux-64          2.40                 h12ee557_0
libffi                    3.4.4                h6a678d5_1
libgcc-ng                 11.2.0               h1234567_1
libgomp                   11.2.0               h1234567_1
libstdcxx-ng              11.2.0               h1234567_1
libuuid                   1.41.5               h5eee18b_0
lightning                 2.0.9.post0              pypi_0    pypi
lightning-cloud           0.5.70                   pypi_0    pypi
lightning-utilities       0.11.9                   pypi_0    pypi
lit                       18.1.8                   pypi_0    pypi
llvmlite                  0.43.0                   pypi_0    pypi
lxml                      5.3.0                    pypi_0    pypi
markdown                  3.7                      pypi_0    pypi
markdown-it-py            3.0.0                    pypi_0    pypi
markupsafe                3.0.2                    pypi_0    pypi
matplotlib                3.9.2                    pypi_0    pypi
mdurl                     0.1.2                    pypi_0    pypi
mpmath                    1.3.0                    pypi_0    pypi
multidict                 6.1.0                    pypi_0    pypi
ncurses                   6.4                  h6a678d5_0
networkx                  3.4.2                    pypi_0    pypi
numba                     0.60.0                   pypi_0    pypi
numpy                     1.26.4                   pypi_0    pypi
nvidia-cublas-cu11        11.10.3.66               pypi_0    pypi
nvidia-cuda-cupti-cu11    11.7.101                 pypi_0    pypi
nvidia-cuda-nvrtc-cu11    11.7.99                  pypi_0    pypi
nvidia-cuda-runtime-cu11  11.7.99                  pypi_0    pypi
nvidia-cudnn-cu11         8.5.0.96                 pypi_0    pypi
nvidia-cufft-cu11         10.9.0.58                pypi_0    pypi
nvidia-curand-cu11        10.2.10.91               pypi_0    pypi
nvidia-cusolver-cu11      11.4.0.1                 pypi_0    pypi
nvidia-cusparse-cu11      11.7.4.91                pypi_0    pypi
nvidia-nccl-cu11          2.14.3                   pypi_0    pypi
nvidia-nvtx-cu11          11.7.91                  pypi_0    pypi
openssl                   3.0.15               h5eee18b_0
ordered-set               4.1.0                    pypi_0    pypi
packaging                 24.2                     pypi_0    pypi
pillow                    11.0.0                   pypi_0    pypi
pip                       24.2            py310h06a4308_0
propcache                 0.2.0                    pypi_0    pypi
protobuf                  5.28.3                   pypi_0    pypi
psutil                    6.1.0                    pypi_0    pypi
pydantic                  2.1.1                    pypi_0    pypi
pydantic-core             2.4.0                    pypi_0    pypi
pygments                  2.18.0                   pypi_0    pypi
pyjwt                     2.10.0                   pypi_0    pypi
pyparsing                 3.2.0                    pypi_0    pypi
pyteomics                 4.7.5                    pypi_0    pypi
python                    3.10.15              he870216_1
python-dateutil           2.9.0.post0              pypi_0    pypi
python-multipart          0.0.17                   pypi_0    pypi
pytorch-lightning         1.9.5                    pypi_0    pypi
pytz                      2024.2                   pypi_0    pypi
pyyaml                    6.0.2                    pypi_0    pypi
rdkit                     2024.3.6                 pypi_0    pypi
readchar                  4.2.1                    pypi_0    pypi
readline                  8.2                  h5eee18b_0
requests                  2.32.3                   pypi_0    pypi
rich                      13.9.4                   pypi_0    pypi
runs                      1.2.2                    pypi_0    pypi
s3transfer                0.10.4                   pypi_0    pypi
selfies                   2.1.2                    pypi_0    pypi
setuptools                75.1.0          py310h06a4308_0
six                       1.16.0                   pypi_0    pypi
sniffio                   1.3.1                    pypi_0    pypi
sortedcontainers          2.4.0                    pypi_0    pypi
soupsieve                 2.6                      pypi_0    pypi
spectrum-utils            0.4.2                    pypi_0    pypi
sqlite                    3.45.3               h5eee18b_0
starlette                 0.41.3                   pypi_0    pypi
starsessions              1.3.0                    pypi_0    pypi
sympy                     1.13.3                   pypi_0    pypi
tensorboard               2.18.0                   pypi_0    pypi
tensorboard-data-server   0.7.2                    pypi_0    pypi
tk                        8.6.14               h39e8969_0
torch                     2.0.1                    pypi_0    pypi
torchmetrics              1.6.0                    pypi_0    pypi
tqdm                      4.67.1                   pypi_0    pypi
traitlets                 5.14.3                   pypi_0    pypi
triton                    2.0.0                    pypi_0    pypi
types-python-dateutil     2.9.0.20241003           pypi_0    pypi
typing-extensions         4.12.2                   pypi_0    pypi
tzdata                    2024b                h04d1e81_0
urllib3                   2.2.3                    pypi_0    pypi
uvicorn                   0.32.1                   pypi_0    pypi
wcwidth                   0.2.13                   pypi_0    pypi
websocket-client          1.8.0                    pypi_0    pypi
websockets                12.0                     pypi_0    pypi
werkzeug                  3.1.3                    pypi_0    pypi
wheel                     0.44.0          py310h06a4308_0
xmod                      1.8.1                    pypi_0    pypi
xz                        5.4.6                h5eee18b_1
yarl                      1.18.0                   pypi_0    pypi
zlib                      1.2.13               h5eee18b_1

I also tried a fresh install with version 0.0.4 but I got the exact same error.