Giter Club home page Giter Club logo

Comments (8)

melihyilmaz avatar melihyilmaz commented on July 3, 2024

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.

wsnoble avatar wsnoble commented on July 3, 2024

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.

melihyilmaz avatar melihyilmaz commented on July 3, 2024

I just added this check to both model files and data directories.

from casanovo.

piaopu0120 avatar piaopu0120 commented on July 3, 2024

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.

wfondrie avatar wfondrie commented on July 3, 2024

Can you run the following and post the output?

pip show torch

from casanovo.

piaopu0120 avatar piaopu0120 commented on July 3, 2024

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.

wfondrie avatar wfondrie commented on July 3, 2024

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.

melihyilmaz avatar melihyilmaz commented on July 3, 2024

torch>=1.9 added to setup.cfg, closing this issue.

from casanovo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.