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

KeyError: 'medair' #11

Closed rmd13 closed 8 months ago

rmd13 commented 8 months ago

Hi, I am tring to run a test in Anaconda3 using the command:

(Mediar) E:\BackupVIP\RMD\GreenSoft\Anaconda3\envs\Mediar\Lib\site-packages\MEDI AR>python predict.py --config_path=E:\BackupVIP\RMD\GreenSoft\Anaconda3\envs\Med iar\Lib\site-packages\MEDIAR\config\pred\pred_mediar.json

I download several models and specify the "finetuned\from_phase1.pth" in json file MEDIAR\config\pred\pred_mediar.json as below: { "pred_setups":{ "name": "medair", "input_path":"E:\temp2\Shieh\nucleusInput", "output_path": "E:\temp2\Shieh\nucleusOutput", "make_submission": true, "model_path": "E:\Software\CellSegmentation\MEDIAR\finetuned\from_phase1.pth", "device": "cuda:0", "model":{ "name": "mediar-former", "params": {}, "pretrained":{ "enabled": false } } } } The E:\temp2\Shieh\nucleusInput is a folder having several tif images of DAPI-stained nucleus to segment.

but error appears below. How to solve this problem? Thanks .

================================================== Configuration ===============
===================================
{'pred_setups': {'device': 'cuda:0',
                 'input_path': 'E:\\temp2\\Shieh\\nucleusInput',
                 'make_submission': True,
                 'model': {'name': 'mediar-former',
                           'params': {},
                           'pretrained': {'enabled': False}},
                 'model_path': 'E:\\Software\\CellSegmentation\\MEDIAR\\finetune
d\\from_phase1.pth',
                 'name': 'medair',
                 'output_path': 'E:\\temp2\\Shieh\\nucleusOutput'}}
================================================================================
========================================
Traceback (most recent call last):
  File "E:\BackupVIP\RMD\GreenSoft\Anaconda3\envs\Mediar\Lib\site-packages\MEDIA
R\predict.py", line 74, in <module>
    main(opt)
  File "E:\BackupVIP\RMD\GreenSoft\Anaconda3\envs\Mediar\Lib\site-packages\MEDIA
R\predict.py", line 40, in main
    predictor = PREDICTOR[args.pred_setups.name](
KeyError: 'medair'