Noble-Lab / casanovo

De Novo Mass Spectrometry Peptide Sequencing with a Transformer Model
https://casanovo.readthedocs.io
Apache License 2.0
116 stars 39 forks source link

Casanovo Denovo Error #118

Closed kostrouc closed 1 year ago

kostrouc commented 1 year ago

I have attempted to run casanovo on previous mgf files that were successfully processed in casanovo a month ago using a GPU Enabled Ubuntu instance. Now, casanovo is giving this error whenever I try to process any file that is not the example sample_preprocessed_spectra.mgf: "11,495 WARNING [py.warnings/MainProcess] warnings._showwarnmsg : /home/kostrouchov/anaconda3/envs/casanovo_env/lib/python3.8/site-packages/numpy/core/_methods.py:190: RuntimeWarning: invalid value encountered in double_scalars ret = ret.dtype.type(ret / rcount)"

I have uninstalled casanovo with pip and also installed using both the github repo and the conda casanovo version. Neither are successful.

(casanovo_env) kostrouchov@myip5:~$ casanovo --mode=denovo --model ./casanovo_massivekb.ckpt --peak_path=ChKn.mgf
Global seed set to 454
2023-01-12 15:14:40,329 INFO [casanovo/MainProcess] casanovo.main : Casanovo version 3.2.1.dev2+gc9ec696
2023-01-12 15:14:40,329 DEBUG [casanovo/MainProcess] casanovo.main : mode = denovo
2023-01-12 15:14:40,331 DEBUG [casanovo/MainProcess] casanovo.main : model = ./casanovo_massivekb.ckpt
2023-01-12 15:14:40,331 DEBUG [casanovo/MainProcess] casanovo.main : peak_path = ChKn.mgf
2023-01-12 15:14:40,331 DEBUG [casanovo/MainProcess] casanovo.main : peak_path_val = None
2023-01-12 15:14:40,331 DEBUG [casanovo/MainProcess] casanovo.main : config = /home/kostrouchov/anaconda3/envs/casanovo_env/lib/python3.8/site-packages/casanovo/config.yaml
2023-01-12 15:14:40,331 DEBUG [casanovo/MainProcess] casanovo.main : output = /home/kostrouchov/casanovo_20230112151439
2023-01-12 15:14:40,331 DEBUG [casanovo/MainProcess] casanovo.main : random_seed = 454
2023-01-12 15:14:40,331 DEBUG [casanovo/MainProcess] casanovo.main : n_peaks = 150
2023-01-12 15:14:40,331 DEBUG [casanovo/MainProcess] casanovo.main : min_mz = 50.0
2023-01-12 15:14:40,331 DEBUG [casanovo/MainProcess] casanovo.main : max_mz = 2500.0
2023-01-12 15:14:40,331 DEBUG [casanovo/MainProcess] casanovo.main : min_intensity = 0.01
2023-01-12 15:14:40,332 DEBUG [casanovo/MainProcess] casanovo.main : remove_precursor_tol = 2.0
2023-01-12 15:14:40,332 DEBUG [casanovo/MainProcess] casanovo.main : max_charge = 10
2023-01-12 15:14:40,332 DEBUG [casanovo/MainProcess] casanovo.main : precursor_mass_tol = 50.0
2023-01-12 15:14:40,332 DEBUG [casanovo/MainProcess] casanovo.main : isotope_error_range = (0, 1)
2023-01-12 15:14:40,332 DEBUG [casanovo/MainProcess] casanovo.main : dim_model = 512
2023-01-12 15:14:40,332 DEBUG [casanovo/MainProcess] casanovo.main : n_head = 8
2023-01-12 15:14:40,332 DEBUG [casanovo/MainProcess] casanovo.main : dim_feedforward = 1024
2023-01-12 15:14:40,332 DEBUG [casanovo/MainProcess] casanovo.main : n_layers = 9
2023-01-12 15:14:40,332 DEBUG [casanovo/MainProcess] casanovo.main : dropout = 0.0
2023-01-12 15:14:40,332 DEBUG [casanovo/MainProcess] casanovo.main : dim_intensity = None
2023-01-12 15:14:40,332 DEBUG [casanovo/MainProcess] casanovo.main : custom_encoder = None
2023-01-12 15:14:40,332 DEBUG [casanovo/MainProcess] casanovo.main : max_length = 100
2023-01-12 15:14:40,332 DEBUG [casanovo/MainProcess] casanovo.main : residues = {'G': 57.021464, 'A': 71.037114, 'S': 87.032028, 'P': 97.052764, 'V': 99.068414, 'T': 101.04767, 'C+57.021': 160.030649, 'L': 113.084064, 'I': 113.084064, 'N': 114.042927, 'D': 115.026943, 'Q': 128.058578, 'K': 128.094963, 'E': 129.042593, 'M': 131.040485, 'H': 137.058912, 'F': 147.068414, 'R': 156.101111, 'Y': 163.063329, 'W': 186.079313, 'M+15.995': 147.0354, 'N+0.984': 115.026943, 'Q+0.984': 129.042594, '+42.011': 42.010565, '+43.006': 43.005814, '-17.027': -17.026549, '+43.006-17.027': 25.980265}
2023-01-12 15:14:40,332 DEBUG [casanovo/MainProcess] casanovo.main : n_log = 1
2023-01-12 15:14:40,333 DEBUG [casanovo/MainProcess] casanovo.main : tb_summarywriter = None
2023-01-12 15:14:40,333 DEBUG [casanovo/MainProcess] casanovo.main : warmup_iters = 100000
2023-01-12 15:14:40,333 DEBUG [casanovo/MainProcess] casanovo.main : max_iters = 600000
2023-01-12 15:14:40,333 DEBUG [casanovo/MainProcess] casanovo.main : learning_rate = 0.0005
2023-01-12 15:14:40,333 DEBUG [casanovo/MainProcess] casanovo.main : weight_decay = 1e-05
2023-01-12 15:14:40,333 DEBUG [casanovo/MainProcess] casanovo.main : train_batch_size = 32
2023-01-12 15:14:40,333 DEBUG [casanovo/MainProcess] casanovo.main : predict_batch_size = 1024
2023-01-12 15:14:40,333 DEBUG [casanovo/MainProcess] casanovo.main : n_beams = 5
2023-01-12 15:14:40,333 DEBUG [casanovo/MainProcess] casanovo.main : logger = None
2023-01-12 15:14:40,333 DEBUG [casanovo/MainProcess] casanovo.main : max_epochs = 30
2023-01-12 15:14:40,333 DEBUG [casanovo/MainProcess] casanovo.main : num_sanity_val_steps = 0
2023-01-12 15:14:40,333 DEBUG [casanovo/MainProcess] casanovo.main : train_from_scratch = True
2023-01-12 15:14:40,333 DEBUG [casanovo/MainProcess] casanovo.main : save_model = True
2023-01-12 15:14:40,333 DEBUG [casanovo/MainProcess] casanovo.main : model_save_folder_path =
2023-01-12 15:14:40,334 DEBUG [casanovo/MainProcess] casanovo.main : save_weights_only = True
2023-01-12 15:14:40,334 DEBUG [casanovo/MainProcess] casanovo.main : every_n_train_steps = 50000
2023-01-12 15:14:40,334 DEBUG [casanovo/MainProcess] casanovo.main : n_workers = 8
2023-01-12 15:14:40,334 INFO [casanovo/MainProcess] casanovo.main : Predict peptide sequences with Casanovo.
2023-01-12 15:14:40,459 DEBUG [fsspec.local/MainProcess] local.__init__ : open file: /home/kostrouchov/./casanovo_massivekb.ckpt
2023-01-12 15:14:40,731 INFO [depthcharge.data.hdf5/MainProcess] hdf5.__init__ : Reading 1 files...
ChKn.mgf: 21959spectra [00:04, 4924.62spectra/s]
2023-01-12 15:14:47,012 WARNING [py.warnings/MainProcess] warnings._showwarnmsg : /home/kostrouchov/anaconda3/envs/casanovo_env/lib/python3.8/site-packages/lightning_lite/plugins/environments/slurm.py:167: PossibleUserWarning: The `srun` command is available on your system but is not used. HINT: If your intention is to run Lightning on SLURM, prepend your python command with `srun` like so: srun python /home/kostrouchov/anaconda3/envs/casanovo_env/bin/ca ...
  rank_zero_warn(

Predicting DataLoader 0:   0%|                                                                                            | 0/22 [00:00<?, ?it/s]2023-01-12 15:15:09,389 WARNING [py.warnings/MainProcess] warnings._showwarnmsg : /home/kostrouchov/anaconda3/envs/casanovo_env/lib/python3.8/site-packages/torch/nn/modules/transformer.py:276: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. (Triggered internally at ../aten/src/ATen/NestedTensorImpl.cpp:175.)
  output = torch._nested_tensor_from_mask(output, src_key_padding_mask.logical_not(), mask_check=False)

2023-01-12 15:15:11,495 WARNING [py.warnings/MainProcess] warnings._showwarnmsg : /home/kostrouchov/anaconda3/envs/casanovo_env/lib/python3.8/site-packages/numpy/core/fromnumeric.py:3432: RuntimeWarning: Mean of empty slice.
  return _methods._mean(a, axis=axis, dtype=dtype,

2023-01-12 15:15:11,495 WARNING [py.warnings/MainProcess] warnings._showwarnmsg : /home/kostrouchov/anaconda3/envs/casanovo_env/lib/python3.8/site-packages/numpy/core/_methods.py:190: RuntimeWarning: invalid value encountered in double_scalars
  ret = ret.dtype.type(ret / rcount)

^C2023-01-12 15:15:23,362 WARNING [py.warnings/MainProcess] warnings._showwarnmsg : /home/kostrouchov/anaconda3/envs/casanovo_env/lib/python3.8/site-packages/pytorch_lightning/trainer/call.py:48: UserWarning: Detected KeyboardInterrupt, attempting graceful shutdown...
  rank_zero_warn("Detected KeyboardInterrupt, attempting graceful shutdown...")
bittremieux commented 1 year ago

These are not errors but warnings, and should not prevent Casanovo from running. Depending on how large your input file is, it can take a little bit of start-up time before the progress bar starts updating. So I would recommend you try it again and don't kill the process immediately.

kostrouc commented 1 year ago

It's working. Thank you!