Comments (8)
Hi,
The first command starting with casanovo
is correct but for --model_path
you should specify the filename, e.g. .../pretrained_excl_bacillus.ckpt
, instead the of the directory. Let me know if that helps!
from casanovo.
Melih, can you add to the code a line to check whether the given argument is a file or a directory and to issue an error statement in the latter case?
from casanovo.
I just added this check to both model files and data directories.
from casanovo.
Hi, I tried the new command, but still got this wrong.
casanovo --mode=eval --model_path='./model/pretrained_excl_human.ckpt' --test_data_path='./data/' --config_path='../../casanovo/config.py'
====
INFO: Evaluating Casanovo...
Traceback (most recent call last):
File "/usr/local/bin/casanovo", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/casanovo/casanovo.py", line 37, in main
test_evaluate(test_data_path, model_path, config_path)
File "/usr/local/lib/python3.8/dist-packages/casanovo/denovo/train_test.py", line 146, in test_evaluate
model_trained = Spec2Pep().load_from_checkpoint(
File "/usr/local/lib/python3.8/dist-packages/casanovo/denovo/model.py", line 103, in __init__
self.encoder = SpectrumEncoder(
File "/usr/local/lib/python3.8/dist-packages/depthcharge/components/transformers.py", line 60, in __init__
layer = torch.nn.TransformerEncoderLayer(
TypeError: __init__() got an unexpected keyword argument 'batch_first'
from casanovo.
Can you run the following and post the output?
pip show torch
from casanovo.
Name: torch
Version: 1.8.0+cu111
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: PyTorch Team
Author-email: [email protected]
License: BSD-3
Location: /usr/local/lib/python3.8/dist-packages
Requires: numpy, typing-extensions
Required-by: casanovo, depthcharge-ms, efficientnet-pytorch, pretrainedmodels, pytorch-lightning, timm, torchaudio, torchmetrics, torchvision
from casanovo.
Thanks @piaopu0120. You'll need to upgrade to PyTorch >= 1.9 to use Casanovo. Version 1.9 is when they added the batch_first
parameter. If you installed PyTorch with pip, you can do this with:
pip install --upgrade torch
@melihyilmaz - can you update setup.cfg
to specify torch>=1.9 as a dependency?
from casanovo.
torch>=1.9 added to setup.cfg
, closing this issue.
from casanovo.
Related Issues (20)
- What is the criteria of saving the top k models in Casanovo version 4? HOT 1
- add additional inputs to encoder and decoder HOT 1
- Add contrastive loss term
- Implement bidirectional decoding HOT 1
- Add rotary embeddings
- mzTab validation
- Automate mzTab validation HOT 7
- More information about the train/val/test split HOT 2
- WARNING: Skipped spectra with invalid precursor info HOT 1
- Export casanovo to torchscript/onnx HOT 1
- ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() HOT 3
- Make Casanovo produce Skyline compatible output
- 9-Species Benchmark Set: Data Preprocessing Step? HOT 5
- Migrating PeptideMass, PeptideDecoder, and PeptideEncoder from depthcharge v0.2.3 to casanovo HOT 3
- Is there a way to know which spectras are ITMS instead of FTMS? HOT 3
- Numpy release 2.0.0 breaks depthcharge dependency HOT 2
- Use Fourier embeddings
- Add mzTab validator to github actions HOT 1
- Make Casanovo model compatible with torch.compile
- Designate a filename for the "best" model HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from casanovo.