TencentAILabHealthcare / scPROTEIN

Apache License 2.0
44 stars 8 forks source link

Docker image and python dependencies #2

Closed cvanderaa closed 5 months ago

cvanderaa commented 11 months ago

Hello,

I'm very interested in testing your method! I have been trying to run the python code locally, but I am stuck into version installation issues. Before spending time into solving the problem, I was relieved to read that you provide a Docker image! :pray: I followed the instruction in the README, but when I attempt to run the code within the container, the python libraries are missing...

Did you configure the Docker image with a conda virtual environment with all dependencies already installed?

nkuweili commented 10 months ago

Hi @cvanderaa Thanks for you interest of our method! We have provided the Docker environment of scPROTEIN, along with the installation instructions in the README.md file, which we hope can help you. The docker file contains python and all the used packages. After you have run a container with our IMAGE, you can use "python3 xx.py" to run the script :)

cvanderaa commented 10 months ago

Hi @nkuweili ! Many thanks for your kind answer. My apologies for the noise, I had some issues to clone the GitHub repo (No route to host error) and I later forgot I was using another Docker image :sweat: I can now access the libraries and launch your peptide_uncertainty_train.py script, but hit an error after 20 seconds or so. Here is the output of my console:

peptides nums in total: 9354
cell nums: 1490
Traceback (most recent call last):
  File "peptide_uncertainty_train.py", line 65, in <module>
    uncertainty = scPROTEIN_stage1.uncertainty_generation()
  File "/home/scPROTEIN/peptide_uncertainty_estimation/multi_task_heteroscedastic_regression_model.py", line 109, in uncertainty_generation
    y_predict_all = self.model(self.peptide_onehot_padding)
  File "/usr/local/python/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/scPROTEIN/peptide_uncertainty_estimation/multi_task_heteroscedastic_regression_model.py", line 43, in forward
    x = self.convs[i](x)
  File "/usr/local/python/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/usr/local/python/lib/python3.8/site-packages/torch/nn/modules/container.py", line 141, in forward
    input = module(input)
  File "/usr/local/python/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/usr/local/python/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 301, in forward
    return self._conv_forward(input, self.weight, self.bias)
  File "/usr/local/python/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 297, in _conv_forward
    return F.conv1d(input, weight, bias, self.stride,
RuntimeError: Unable to find a valid cuDNN algorithm to run convolution

I have no experience with cuDNN, so I don't know what could cause the errror. Would it be related to GPU? I made sure to launch the Docker image with the --gpus all tag. Here are my CUDA settings in case it may help:

nvcc --version

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Mon_May__3_19:15:13_PDT_2021
Cuda compilation tools, release 11.3, V11.3.109
Build cuda_11.3.r11.3/compiler.29920130_0

I would really appreciate your guidance and sorry in advance if this is a simple issue.

nkuweili commented 10 months ago

Hi @cvanderaa , we hope the following solutions can help you:

  1. If you encounter issues in the Docker environment when running 'git clone' on your device, you can first try to execute the following command before running 'git clone' for proxy: git config --global http.proxy "" This should help you for the git clone step.

  2. When encountering the error message "Unable to find a valid cuDNN algorithm to run convolution" on your device, here are some steps that may help you to resolve this error: (1) Update or install cuDNN: Sometimes, updating cuDNN can resolve compatibility issues. (2) Memory Issues: Sometimes, this error can occur due to GPU memory issues. Ensure that your GPU has enough memory to run the model. Additionally, ensure that your GPU hardware is functioning correctly, as hardware issues can sometimes lead to cuDNN errors.