jbdel / vilmedic

ViLMedic (Vision-and-Language medical research) is a modular framework for vision and language multimodal research in the medical field
MIT License
151 stars 20 forks source link

KeyError during creating mimic-cxr selfsup datasets #19

Closed taokz closed 11 months ago

taokz commented 11 months ago

Hi, thank you for providing your great code repo!

When I run ''python make_mimic_cxr.py --task selfup``, I got the key error as follows:

#### mimic-cxr-2.0.0-splits.csv 377110it [00:03, 103239.15it/s] Traceback (most recent call last): File "/data/usr/vilmedic/data/make_datasets/mimic_cxr/make_mimic_cxr.py", line 191, in main() File "/data/usr/vilmedic/data/make_datasets/mimic_cxr/make_mimic_cxr.py", line 175, in main reports["impression"][study_id] + ' ' + reports["findings"][study_id] + '\n') KeyError: 's50985099'

Besides, I would like to know if ''python get_chexbert_label.py {PATH_TO_REPORT_FILE}`` creates the label for each image in a study. BTW, according to the readme, it should be--task selfsup but I looked at the code and find it should be selfup:

RULES = { 'rrg': ['findings', 'impression'], 'rrs': ['impression_and_findings'], 'selfup': ['impression_and_or_findings'], }

I think it is a typo.

Thanks!

jbdel commented 11 months ago

There was indeed a small error.

Please pull last code and rerun python make_mimic_cxr.py --task selfup again