lhoyer / DAFormer

[CVPR22] Official Implementation of DAFormer: Improving Network Architectures and Training Strategies for Domain-Adaptive Semantic Segmentation
Other
470 stars 93 forks source link

KeyError: 'gta\\labels\\13432_labelTrainIds.png' #24

Closed mkbkxdd closed 2 years ago

mkbkxdd commented 2 years ago

Hi, thank you for your wonderful work, but I have a question for you. I would appreciate it if you could answer it.

When I run “python run_experiments.py --config configs/daformer/gta2cs_uda_warm_fdthings_rcs_croppl_a999_daformer_mitb5_s0.py", in Windows, I got this problem : KeyError: 'gta\labels\13438_labelTrainIds.png'. And the error is as follows:

Traceback (most recent call last): File "run_experiments.py", line 103, in train.main([config_files[i]]) File "E:\Project\DAFormer-master\tools\train.py", line 166, in main train_segmentor( File "E:\Project\DAFormer-master\mmseg\apis\train.py", line 131, in train_segmentor runner.run(data_loaders, cfg.workflow) File "c:\programdata\mmcv-1.3.7\mmcv\runner\iter_based_runner.py", line 131, in run iter_runner(iter_loaders[i], **kwargs) File "c:\programdata\mmcv-1.3.7\mmcv\runner\iter_based_runner.py", line 58, in train data_batch = next(data_loader) File "c:\programdata\mmcv-1.3.7\mmcv\runner\iter_based_runner.py", line 32, in next data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\ProgramData\Anaconda3\envs\torch3.8\lib\site-packages\torch\utils\data_utils\fetch.py", line 49, in data = [self.dataset[idx] for idx in possibly_batched_index] File "E:\Project\DAFormer-master\mmseg\datasets\uda_dataset.py", line 113, in getitem return self.get_rare_class_sample() File "E:\Project\DAFormer-master\mmseg\datasets\uda_dataset.py", line 90, in get_rare_class_sample i1 = self.file_to_idx[f1] KeyError: 'gta\labels\13432_labelTrainIds.png'

lhoyer commented 2 years ago

Thank you for your interest in our work!

I'm sorry but we do not support Windows. I would recommend installing an Ubuntu system as dual boot.

Based on the error, it could also be that you did not convert the datasets as explained in https://github.com/lhoyer/DAFormer#setup-datasets.

mkbkxdd commented 2 years ago

Thank you for your interest in our work!

I'm sorry but we do not support Windows. I would recommend installing an Ubuntu system as dual boot.

Based on the error, it could also be that you did not convert the datasets as explained in https://github.com/lhoyer/DAFormer#setup-datasets.

Thanks for your reply , I changed all 'gta\labels\*_labelTrainIds.png' with 'gta/labels/*_labelTrainIds.png' in all json files , then the problem is solved,and it can run in Windows!Thanks for you again!

BUAA-LKG commented 2 years ago

Thank you for your interest in our work! I'm sorry but we do not support Windows. I would recommend installing an Ubuntu system as dual boot. Based on the error, it could also be that you did not convert the datasets as explained in https://github.com/lhoyer/DAFormer#setup-datasets.

Thanks for your reply , I changed all 'gta\labels*_labelTrainIds.png' with 'gta/labels/*_labelTrainIds.png' in all json files , then the problem is solved,and it can run in Windows!Thanks for you again!

I'd like to ask you what you run under Windows system, because I can't install mmcv all the time

YYDSDD commented 2 years ago

Thank you for your interest in our work! I'm sorry but we do not support Windows. I would recommend installing an Ubuntu system as dual boot. Based on the error, it could also be that you did not convert the datasets as explained in https://github.com/lhoyer/DAFormer#setup-datasets.

Thanks for your reply , I changed all '*gta\labels_labelTrainIds.png' with 'gta/labels/_labelTrainIds.png*' in all json files , then the problem is solved,and it can run in Windows!Thanks for you again!

I'd like to ask you what you run under Windows system, because I can't install mmcv all the time

look this:https://mmcv.readthedocs.io/en/latest/get_started/build.html#build-on-windows or https://blog.csdn.net/qq_21539375/article/details/118790214?ops_request_misc=&request_id=&biz_id=102&utm_term=win10%E5%AE%89%E8%A3%85mmcv&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduweb~default-3-118790214.142^v10^pc_search_result_control_group,157^v5^control&spm=1018.2226.3001.4187

tonyRyo commented 10 months ago

Thank you for your interest in our work! I'm sorry but we do not support Windows. I would recommend installing an Ubuntu system as dual boot. Based on the error, it could also be that you did not convert the datasets as explained in https://github.com/lhoyer/DAFormer#setup-datasets.

Thanks for your reply , I changed all 'gta\labels*_labelTrainIds.png' with 'gta/labels/*_labelTrainIds.png' in all json files , then the problem is solved,and it can run in Windows!Thanks for you again!

Thank you so much, you saved my ass!

ZhenboZhao77 commented 6 months ago

Traceback (most recent call last): File "run_experiments.py", line 106, in train.main([config_files[i]]) File "D:\papaer_code\DAFormer\tools\train.py", line 166, in main train_segmentor( File "D:\papaer_code\DAFormer\mmseg\apis\train.py", line 131, in train_segmentor runner.run(data_loaders, cfg.workflow) File "D:\app\anaconda\envs\daformer\lib\site-packages\mmcv\runner\iter_based_runner.py", line 131, in run iter_runner(iter_loaders[i], **kwargs) File "D:\app\anaconda\envs\daformer\lib\site-packages\mmcv\runner\iter_based_runner.py", line 58, in train data_batch = next(data_loader) File "D:\app\anaconda\envs\daformer\lib\site-packages\mmcv\runner\iter_based_runner.py", line 32, in next data = next(self.iter_loader) File "D:\app\anaconda\envs\daformer\lib\site-packages\torch\utils\data\dataloader.py", line 435, in next data = self._next_data() File "D:\app\anaconda\envs\daformer\lib\site-packages\torch\utils\data\dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "D:\app\anaconda\envs\daformer\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "D:\app\anaconda\envs\daformer\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "D:\papaer_code\DAFormer\mmseg\datasets\uda_dataset.py", line 116, in getitem return self.get_rare_class_sample() File "D:\papaer_code\DAFormer\mmseg\datasets\uda_dataset.py", line 93, in get_rare_class_sample i1 = self.file_to_idx[f1] KeyError: '13432_labelTrainIds.png'

Hello! I am running this program on Windows 11. After reading your explanation above, I was greatly inspired and made the path changes as you described. However, there are still some errors. Could you please take a moment to look at it?