cuiziteng / Illumination-Adaptive-Transformer

🌕 [BMVC 2022] You Only Need 90K Parameters to Adapt Light: A Light Weight Transformer for Image Enhancement and Exposure Correction. SOTA for low light enhancement, 0.004 seconds try this for pre-processing.
Apache License 2.0
459 stars 43 forks source link

train报错 #51

Closed DreannER closed 1 year ago

DreannER commented 1 year ago

大佬你好,在follow代码的时候train过程报错, (IAT) zhaojb1@zhaojb1-Lenovo-Legion-R9000K2021H:~/cdy/Illumination-Adaptive-Transformer/IAT_enhance$ python train_lol_v2.py --gpu_id 0 --img_path /home/zhaojb1/cdy/Illumination-Adaptive-Transformer/IAT_enhance/LOL_v2/Real_captured/Train/Low --img_val_path /home/zhaojb1/cdy/Illumination-Adaptive-Transformer/IAT_enhance/LOL_v2/Real_captured/Test/Low/ Namespace(batch_size=8, display_iter=10, gpu_id='0', img_path='/home/zhaojb1/cdy/Illumination-Adaptive-Transformer/IAT_enhance/LOL_v2/Real_captured/Train/Low', img_val_path='/home/zhaojb1/cdy/Illumination-Adaptive-Transformer/IAT_enhance/LOL_v2/Real_captured/Test/Low/', lr=0.0002, model_type='s', normalize=True, num_epochs=200, pretrain_dir=None, snapshots_folder='workdirs/snapshots_folder_lol', weight_decay=0.0005) Total examples: 0 train_dataset: <data_loaders.lol.lowlight_loader object at 0x7fbc82edeb70> Traceback (most recent call last): File "train_lol_v2.py", line 57, in pin_memory=True) File "/home/zhaojb1/miniconda3/envs/IAT/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 262, in init sampler = RandomSampler(dataset, generator=generator) # type: ignore File "/home/zhaojb1/miniconda3/envs/IAT/lib/python3.7/site-packages/torch/utils/data/sampler.py", line 104, in init "value, but got num_samples={}".format(self.num_samples)) ValueError: num_samples should be a positive integer value, but got num_samples=0

似乎数据loader有问题,但是文件路径我都把yourpath改掉了,检查没有问题,请问是什么情况呢?

cuiziteng commented 1 year ago

img_path='/home/zhaojb1/cdy/Illumination-Adaptive-Transformer/IAT_enhance/LOL_v2/Real_captured/Train/Low' 记得改成 img_path='/home/zhaojb1/cdy/Illumination-Adaptive-Transformer/IAT_enhance/LOL_v2/Real_captured/Train/Low/ '