Lee-Gihun / MEDIAR

(NeurIPS 2022 CellSeg Challenge - 1st Winner) Open source code for "MEDIAR: Harmony of Data-Centric and Model-Centric for Multi-Modality Microscopy"
MIT License
137 stars 30 forks source link

RuntimeError: Found no NVIDIA driver on your system. #12

Closed rmd13 closed 8 months ago

rmd13 commented 8 months ago

Hi, I have managed to install the MEDIAR and run the colab demo script in-line code line-by-line. In the line _ = predictor.conduct_prediction() it shows the error no NVIDIA driver. My laptop has no GPU, could MEDIAR run without GPU? In the code below, does map_location="cpu" already specify using CPU? Or is there other ways to specify use CPU instead of GPU? Thanks.

weights1 = torch.load(model_path1, map_location="cpu")
weights2 = torch.load(model_path2, map_location="cpu")
model_args = {
    "classes": 3,
    "decoder_channels": [1024, 512, 256, 128, 64],
    "decoder_pab_channels": 256,
    "encoder_name": 'mit_b5',
    "in_channels": 3
}
model1 = MEDIARFormer(**model_args)
model1.load_state_dict(weights1, strict=False)
model2 = MEDIARFormer(**model_args)
model2.load_state_dict(weights2, strict=False)

predictor = Predictor(model1, "cuda:0", input_path, output_path, algo_params={"use_tta": False})
_ = predictor.conduct_prediction()

Traceback (most recent call last): File "", line 1, in File "E:\BackupVIP\RMD\GreenSoft\Anaconda3\envs\Mediar\lib\site-packages\torch \autograd\grad_mode.py", line 27, in decorate_context return func(*args, **kwargs) File "E:\BackupVIP\RMD\GreenSoft\Anaconda3\envs\Mediar\Lib\site-packages\MEDIA R\core\BasePredictor.py", line 40, in conduct_prediction self.model.to(self.device) File "E:\BackupVIP\RMD\GreenSoft\Anaconda3\envs\Mediar\lib\site-packages\torch \nn\modules\module.py", line 927, in to return self._apply(convert) File "E:\BackupVIP\RMD\GreenSoft\Anaconda3\envs\Mediar\lib\site-packages\torch \nn\modules\module.py", line 579, in _apply module._apply(fn) File "E:\BackupVIP\RMD\GreenSoft\Anaconda3\envs\Mediar\lib\site-packages\torch \nn\modules\module.py", line 579, in _apply module._apply(fn) File "E:\BackupVIP\RMD\GreenSoft\Anaconda3\envs\Mediar\lib\site-packages\torch \nn\modules\module.py", line 579, in _apply module._apply(fn) File "E:\BackupVIP\RMD\GreenSoft\Anaconda3\envs\Mediar\lib\site-packages\torch \nn\modules\module.py", line 602, in _apply param_applied = fn(param) File "E:\BackupVIP\RMD\GreenSoft\Anaconda3\envs\Mediar\lib\site-packages\torch \nn\modules\module.py", line 925, in convert return t.to(device, dtype if t.is_floating_point() or t.is_complex() else No ne, non_blocking) File "E:\BackupVIP\RMD\GreenSoft\Anaconda3\envs\Mediar\lib\site-packages\torch \cuda__init__.py", line 217, 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.a spx

rmd13 commented 8 months ago

change "cuda:0" to "cpu" works