proteus1991 / GridDehazeNet

This repo contains the official training and testing codes for our paper: GridDehazeNet: Attention-Based Multi-Scale Network for Image Dehazing.
https://jhc.sjtu.edu.cn/~xiaohongliu/
241 stars 54 forks source link

I have some question when training by my own dataset #11

Closed zkh123456789 closed 4 years ago

zkh123456789 commented 4 years ago

I'm sorry to bother you, but I want to use my own dataset for training and testing, but I keep reporting errors during training. I'd appreciate it if you could help me solve this problem. wit@wit:/media/wit/Data/zkh/GridDehazeNet-master$ python3 train.py --- Hyper-parameters for training --- learning_rate: 0.001 crop_size: [240, 240] train_batch_size: 18 val_batch_size: 1 network_height: 3 network_width: 6 num_dense_layer: 4 growth_rate: 16 lambda_loss: 0.04 category: indoor --- no weight loaded --- Total_params: 958051 Traceback (most recent call last): File "train.py", line 116, in old_val_psnr, old_val_ssim = validation(net, val_data_loader, device, category) File "/media/wit/Data/zkh/GridDehazeNet-master/utils.py", line 51, in validation for batch_id, val_data in enumerate(val_data_loader): File "/home/wit/.local/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 345, in next data = self._next_data() File "/home/wit/.local/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 856, in _next_data return self._process_data(data) File "/home/wit/.local/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 881, in _process_data data.reraise() File "/home/wit/.local/lib/python3.5/site-packages/torch/_utils.py", line 394, in reraise raise self.exc_type(msg) FileNotFoundError: Caught FileNotFoundError in DataLoader worker process 0. Original Traceback (most recent call last): File "/home/wit/.local/lib/python3.5/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop data = fetcher.fetch(index) File "/home/wit/.local/lib/python3.5/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/wit/.local/lib/python3.5/site-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/media/wit/Data/zkh/GridDehazeNet-master/val_data.py", line 44, in getitem res = self.get_images(index) File "/media/wit/Data/zkh/GridDehazeNet-master/val_data.py", line 33, in get_images gt_img = Image.open(self.val_data_dir + 'clear/' + gt_name) File "/home/wit/.local/lib/python3.5/site-packages/PIL/Image.py", line 2652, in open fp = builtins.open(filename, "rb") FileNotFoundError: [Errno 2] No such file or directory: './data/test/SOTS/indoor/clear/31.png'

proteus1991 commented 4 years ago

Check if the directory './data/test/SOTS/indoor/clear/31.png' is successfully created. You should follow the same directory structure as ours or you need to revise the access path accordingly.

zkh123456789 commented 4 years ago

Check if the directory './data/test/SOTS/indoor/clear/31.png' is successfully created. You should follow the same directory structure as ours or you need to revise the access path accordingly.

thank you very much!