Coder Social home page Coder Social logo

instadeepai / lightmhc Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 0.0 85.45 MB

LightMHC: A Light Model for pMHC Structure Prediction with Graph Neural Networks

Home Page: https://www.biorxiv.org/content/10.1101/2023.11.21.568015v1

License: Other

Python 100.00%
alphafold2 graphneuralnetwork pmhc protein-structure

lightmhc's People

Contributors

antoine-delaunay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lightmhc's Issues

CUDA error, related to multiprocessing

I'm tried to run LightMHC with Cuda 11.8.0

Command:

python LightMHC/lightmhc/inference.py data.input_csv_path=xray.lightmhc.csv data.output_dir=lighmhc-xray model.n_cpus=32 model.use_gpu=true model.batch_size=64

I got an error message:

multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "/home/baakmanc/miniconda3/envs/lightmhc/lib/python3.8/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/home/baakmanc/miniconda3/envs/lightmhc/lib/python3.8/multiprocessing/pool.py", line 51, in starmapstar
    return list(itertools.starmap(args[0], args[1]))
  File "/home/baakmanc/LightMHC/lightmhc/inference.py", line 77, in workflow
    model = model.to(device)
  File "/home/baakmanc/miniconda3/envs/lightmhc/lib/python3.8/site-packages/torch/nn/modules/module.py", line 673, in to
    return self._apply(convert)
  File "/home/baakmanc/miniconda3/envs/lightmhc/lib/python3.8/site-packages/torch/nn/modules/module.py", line 387, in _apply
    module._apply(fn)
  File "/home/baakmanc/miniconda3/envs/lightmhc/lib/python3.8/site-packages/torch/nn/modules/module.py", line 387, in _apply
    module._apply(fn)
  File "/home/baakmanc/miniconda3/envs/lightmhc/lib/python3.8/site-packages/torch/nn/modules/module.py", line 387, in _apply
    module._apply(fn)
  File "/home/baakmanc/miniconda3/envs/lightmhc/lib/python3.8/site-packages/torch/nn/modules/module.py", line 409, in _apply
    param_applied = fn(param)
  File "/home/baakmanc/miniconda3/envs/lightmhc/lib/python3.8/site-packages/torch/nn/modules/module.py", line 671, in convert
    return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
  File "/home/baakmanc/miniconda3/envs/lightmhc/lib/python3.8/site-packages/torch/cuda/__init__.py", line 160, in _lazy_init
    raise RuntimeError(
RuntimeError: Cannot re-initialize CUDA in forked subprocess. To use CUDA with multiprocessing, you must use the 'spawn' start method
"""

I found that the start method can be set to 'spawn' by following the instructions here:
https://pytorch.org/docs/stable/notes/multiprocessing.html

That fixed the issue for me. Just letting you know.

checkpoints don't match model

The error I previously had:
RuntimeError: Error(s) in loading state_dict for TrEGNN:
size mismatch for backbone_block.transformer.encoders.0.mha_norm.weight: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for backbone_block.transformer.encoders.0.mha_norm.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for backbone_block.transformer.encoders.0.ffn_norm.weight: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for backbone_block.transformer.encoders.0.ffn_norm.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for backbone_block.transformer.encoders.1.mha_norm.weight: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for backbone_block.transformer.encoders.1.mha_norm.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for backbone_block.transformer.encoders.1.ffn_norm.weight: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for backbone_block.transformer.encoders.1.ffn_norm.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for torsion_block.transformer.encoders.0.mha_norm.weight: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for torsion_block.transformer.encoders.0.mha_norm.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for torsion_block.transformer.encoders.0.ffn_norm.weight: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for torsion_block.transformer.encoders.0.ffn_norm.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for torsion_block.transformer.encoders.1.mha_norm.weight: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for torsion_block.transformer.encoders.1.mha_norm.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for torsion_block.transformer.encoders.1.ffn_norm.weight: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for torsion_block.transformer.encoders.1.ffn_norm.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([128]).

Was resolved by downgrading pytorch geometric.

training code

Hello, I'm a reasearcher and I'm working on a paper for methods that predict MHC peptide structures.

I would like to retrain lightMHC on a custom training set, but I cannot find the code to do so.

Does it exist and could I get it?

Thanks!

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.