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

Problem to generate the data #5

Open
raphaelmourad opened this issue Oct 29, 2024 · 3 comments
Open

Problem to generate the data #5

raphaelmourad opened this issue Oct 29, 2024 · 3 comments

Comments

@raphaelmourad
Copy link

Hi,
first, thank you for this great work!

I have a problem when I want to generate scgpt embedding with the corresponding notebook.

When I run:
adata_copy_embeddings = scg.tasks.embed_data(
adata_copy,
model_dir,
gene_col='index',
batch_size=1,
return_new_adata=True,
device='cpu',
#use_fast_transformer=False,
)

I get this:
"The kernel appears to have died. It will restart automatically."
scGPT - INFO - match 5235/5666 genes in vocabulary of size 60697.
/home/mourad/.local/lib/python3.10/site-packages/torch/nn/modules/transformer.py:282: UserWarning: enable_nested_tensor is True, but self.use_nested_tensor is False because encoder_layer was not TransformerEncoderLayer
warnings.warn(f"enable_nested_tensor is True, but self.use_nested_tensor is False because {why_not_sparsity_fast_path}")
Embedding cells: 0%| | 0/111445 [00:00<?, ?it/s]

Please could you help me? I have already preprocessed the data and save it.

@yanwu2014
Copy link
Contributor

Thanks! And at first glance I think you've run out of CPU memory, can you describe the machine you're using and the dataset you're trying to embed?

@raphaelmourad
Copy link
Author

Hi Yu, I have 64Gb of RAM on my CPU. I checked the system monitor of Ubuntu and I didn't see that all the memory was taken.

@yanwu2014
Copy link
Contributor

yanwu2014 commented Nov 5, 2024

Hmm so I'm not able to reproduce this error, can you also create an issue on the scGPT repo since it seems like an scGPT issue? https://github.com/bowang-lab/scGPT/issues

In the meantime I've found the scGPT install to be a bit tricky, this recipe worked for me if you want to give it a shot

conda create -n scgpt-env python=3.10 pip
conda activate scgpt-env

conda install conda-forge::cudatoolkit=11.7 conda-forge::cudatoolkit-dev=11.7 conda-forge::cudnn=8.9.7.29
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
pip install packaging cellxgene-census GitPython transformers datasets tensorboard wandb rich scib ipython torchtext scvi-tools
pip install flash-attn'<'1.0.5 --no-build-isolation
pip install scgpt --no-deps

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