Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notebook getting stuck in installation mode for a long time #2

Open
deepsatflow opened this issue Sep 21, 2024 · 1 comment
Open

Notebook getting stuck in installation mode for a long time #2

deepsatflow opened this issue Sep 21, 2024 · 1 comment

Comments

@deepsatflow
Copy link

image

@hdieckhaus
Copy link

I am having the same issue with the Colab notebook. It appears to be stalling on the first pip install of torch-scatter.

My solution:

  • overwrite the torch version using TORCH=2.3.1
  • use the overwrite I previously used for the right biotite version: os.system(f"pip install biotite==0.41")

so the install block looks like this:

#@title <b><font color='#f0e422'>PRELIMINARY OPERATIONS:</font> Install dependencies

#@markdown Run the cell to install all the extra necessaries packages <b>(~1min 30s)</b>, including:
#@markdown - ESM-IF (library and parameters)
#@markdown - Torch libraries: torch-scatter,-sparse,-cluster,spline-conv,-geometric
#@markdown - Python libraries: biopython, biotite

%%time
import os,time,subprocess,re,sys,shutil
from google.colab import files
import torch
import numpy as np
import pandas as pd

def format_pytorch_version(version):
  return version.split('+')[0]

def format_cuda_version(version):
  return 'cu' + version.replace('.', '')

TORCH_version = torch.__version__
TORCH = format_pytorch_version(TORCH_version)
CUDA_version = torch.version.cuda
CUDA = format_cuda_version(CUDA_version)

TORCH='2.3.1'
print('\n', TORCH, '\n', CUDA)
IF_model_name = "esm_if1_gvp4_t16_142M_UR50.pt"

if not os.path.isfile(IF_model_name):
  # download esmfold params
  os.system("apt-get install aria2 -qq")
  os.system(f"aria2c -x 16 https://sid.erda.dk/share_redirect/eIZVVNEd8B --out={IF_model_name} &")

  if not os.path.isfile("finished_install"):
    # install libs
    print("installing libs...")
    # !pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.3.0+cu121.html
    os.system(f"pip install torch-scatter -v -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html")
    os.system(f"pip install torch-sparse -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html")
    os.system(f"pip install torch-cluster -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html")
    os.system(f"pip install torch-spline-conv -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html")
    os.system(f"pip install torch-geometric")
    os.system(f"pip install biopython")
    # os.system(f"pip install biotite")
    os.system(f"pip install biotite==0.41")


    print("installing esmfold...")
    # install esmfold
    os.system(f"pip install git+https://github.com/matteo-cagiada/esm.git")
    os.system("touch finished_install")

    #wait for Params to finish downloading...
    while not os.path.isfile(IF_model_name):
      time.sleep(5)
    if os.path.isfile(f"{IF_model_name}.aria2"):
      print("downloading params...")
    while os.path.isfile(f"{IF_model_name}.aria2"):
      time.sleep(5)

## Verify that pytorch-geometric is correctly installed

import esm

from esm.inverse_folding.util import load_structure, extract_coords_from_structure,CoordBatchConverter
from esm.inverse_folding.multichain_util import extract_coords_from_complex,_concatenate_coords,load_complex_coords


print("importing the model")

model, alphabet = esm.pretrained.load_model_and_alphabet(IF_model_name)
model.eval().cuda().requires_grad_(False)

print("--> Installations succeeded")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants