snap-stanford/SATURN

train.SATURN ERROR. Is a GPU necessary?

Tongbcc opened this issue · 1 comments

Hello,
I am trying to run train SATURN.ipynb with CPU. input csv and h5ad files were prepared accoring to the Vignettes.
The script I used was:

!python3 /disk2/tbc/softwares/SATURN-main/train-saturn.py --device=cpu \
                              --device_num=0 \
                              --in_data=bichir_bf_run.csv \
                              --in_label_col=seurat_clusters --ref_label_col=seurat_clusters \
                              --num_macrogenes=2000     --hv_genes=8000          \
                              --centroids_init_path=saturn_results/fz_centroids.pkl \
                              --score_adata --ct_map_path=bichir_bf_cell_type_map.csv \
                              --work_dir=. 

However, I got an error report :

Traceback (most recent call last):
  File "/disk2/tbc/softwares/SATURN-main/train-saturn.py", line 1050, in <module>
    torch.cuda.set_device(args.device_num)
  File "/home/tbc/miniconda/envs/SATURN/lib/python3.9/site-packages/torch/cuda/__init__.py", line 408, in set_device
    torch._C._cuda_setDevice(device)
  File "/home/tbc/miniconda/envs/SATURN/lib/python3.9/site-packages/torch/cuda/__init__.py", line 302, in _lazy_init
    torch._C._cuda_init()
RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx

What confused me is that I've already specified --device=CPU, but the error message still relates to the GPU. Is a GPU necessary for running SATURN?

Hello,

I don't think the program will be able to run without a GPU unfortunately.

You can try to modify that code to remove that line.