zychen-ustc / PSD-Principled-Synthetic-to-Real-Dehazing-Guided-by-Physical-Priors

Zeyuan Chen, Yangchao Wang, Yang Yang and Dong Liu. "PSD: Principled Synthetic-to-Real Dehazing Guided by Physical Priors". IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2021.
MIT License
111 stars 18 forks source link

关于test.py报错的问题 #26

Closed Kamehameha111 closed 2 years ago

Kamehameha111 commented 2 years ago

作者您好!首先感谢您的代码与模型。 我根据test.py的

test_data_dir = '/data/nnice1216/Dehazing/unlabeled/'

在PSD文件夹下创建了/data/nnice1216/Dehazing/unlabeled/文件夹,并在unlabeled文件夹中放入一个SOTS测试集的有雾图像,同时把下载好的PSB-MSBDN、PSD-FFANET、PSD-GCANET文件放在PSD文件夹下,然后运行test.py,提示如下错误:

E:\Anaconda3\envs\pytorch\python.exe "E:/0shenduxuexi/【CVPR2021】PSD Principled Synthetic_to_Real Dehazing Guided by Physical Priors/PSD/PSD/PSD/test.py"
Traceback (most recent call last):
  File "E:/0shenduxuexi/【CVPR2021】PSD Principled Synthetic_to_Real Dehazing Guided by Physical Priors/PSD/PSD/PSD/test.py", line 35, in <module>
    test_data_loader = DataLoader(TestData_FFA(test_data_dir), batch_size=1, shuffle=False, num_workers=8) # For FFA and MSBDN
  File "E:\0shenduxuexi\【CVPR2021】PSD Principled Synthetic_to_Real Dehazing Guided by Physical Priors\PSD\PSD\PSD\datasets\pretrain_datasets.py", line 489, in __init__
    self.haze_names = list(os.walk(self.haze_dir))[0][2]
IndexError: list index out of range

进程已结束,退出代码1

我的python版本是3.6.13,pytorch版本是1.10.2。 请问该如何解决?谢谢作者!

zychen-ustc commented 2 years ago

您好,您可能需要把test_data_dir改成'/data/nnice1216/Dehazing/unlabeled/SOTS/'。即文件夹路径下直接包含图片文件,而没有其它文件或是多层的文件夹