mahmoodlab / CLAM

Data-efficient and weakly supervised computational pathology on whole slide images - Nature Biomedical Engineering
http://clam.mahmoodlab.org
GNU General Public License v3.0
1.07k stars 350 forks source link

Problem running split in CONCH/CLAM environment #248

Closed suminwei closed 3 weeks ago

suminwei commented 5 months ago

Hi, I'm running into the following error when trying to run create_splits_seq.py in a conda environment with CONCH and CLAM installed:

python create_splits_seq.py --task task_2_tumor_subtyping --seed 1 --label_frac 1 --k 10

/home/liw165/.local/lib/python3.10/site-packages/torch/cuda/__init__.py:118: UserWarning: CUDA initialization: The NVIDIA driver on your system is too old (found version 11020). Please update your GPU driver by downloading and installing a new version from the URL: http://www.nvidia.com/Download/index.aspx Alternatively, go to: https://pytorch.org to install a PyTorch version that has been compiled with your version of the CUDA driver. (Triggered internally at ../c10/cuda/CUDAFunctions.cpp:108.) return torch._C._cuda_getDeviceCount() > 0 Traceback (most recent call last): File "/n/data1/dfci/medicine/beltran/lab/lwei/Software/CLAM_install/CLAM/create_splits_seq_MLN_CONCH.py", line 35, in <module> dataset = Generic_WSI_Classification_Dataset(csv_path = '/n/data1/dfci/medicine/beltran/lab/lwei/ML/analysis/CLAM/MLN/training_391_CONCH/dataset_csv/tumour_subtyping_clean.csv', File "/n/data1/dfci/medicine/beltran/lab/lwei/Software/CLAM_install/CLAM/datasets/dataset_generic.py", line 76, in __init__ self.patient_data_prep(patient_voting) File "/n/data1/dfci/medicine/beltran/lab/lwei/Software/CLAM_install/CLAM/datasets/dataset_generic.py", line 104, in patient_data_prep label = stats.mode(label)[0] File "/home/liw165/.local/lib/python3.10/site-packages/scipy/stats/_axis_nan_policy.py", line 531, in axis_nan_policy_wrapper res = hypotest_fun_out(*samples, **kwds) File "/home/liw165/.local/lib/python3.10/site-packages/scipy/stats/_stats_py.py", line 522, in mode raise TypeError(message) TypeError: Argumentais not recognized as numeric. Support for input that cannot be coerced to a numeric array was deprecated in SciPy 1.9.0 and removed in SciPy 1.11.0. Please considernp.unique.

fedshyvana commented 3 weeks ago

Hi, sorry for the late reply, hopefully the issue has already been resolved. If not, please feel free to follow up!

WinterPan2017 commented 2 weeks ago

The issue still exists. https://github.com/mahmoodlab/CLAM/blob/8455dc8c4623f8881281c65a3725bbdad99fb59e/dataset_modules/dataset_generic.py#L103 Actually, the issue is related to SciPy. scipy.stats only accepts numeric lists from SciPy 1.9.0 onwards. If the label in csv file is a string, the issue arises. The issue can be solved by downgrading to scipy==1.8 or by replacing scipy.stats with numpy.unique.