how to train it on custom dataset?
anushka17agarwal opened this issue · 3 comments
Hi, I've been trying to run this code on my custom dataset but couldn't understand the directory structure. Can someone help
The data loader assumes that the input and the target have different key strings in their full paths.
By default, it is set as 'blur_gamma' and 'sharp' for GOPRO_Large dataset, 'blur' and 'sharp' for REDS dataset.
ex) gopro_large.py
.../dataset/GOPRO_Large/train/blur_gamma/GOPR0372_07_00/blur_gamma/000047.png
.../dataset/GOPRO_Large/train/blur_gamma/GOPR0372_07_00/sharp/000047.png
You can put blurry images under subfolders named 'blur' and sharp images under 'sharp.'
I tried it still gives this error
warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name))
Traceback (most recent call last):
File "main.py", line 68, in <module>
main()
File "main.py", line 65, in main
main_worker(args.rank, args)
File "main.py", line 15, in main_worker
loaders = Data(args).get_loader()
File "/home/anushka/DeepDeblur-PyTorch/src/data/__init__.py", line 73, in __init__
self.loaders[mode] = _get_data_loader(mode)
File "/home/anushka/DeepDeblur-PyTorch/src/data/__init__.py", line 43, in _get_data_loader
sampler = RandomSampler(dataset, replacement=False)
File "/home/anushka/miniconda3/envs/deblur/lib/python3.6/site-packages/torch/utils/data/sampler.py", line 96, 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
The message means that the code did not locate the dataset.
Did you change --data_root
and --data_train
accordingly?
You may want to check L40-47 in option.py.
For example, if args.data_root
is ~/Research/dataset
and args.data_train
is CustomData
, your dataset path should be something like:
~/Research/dataset/CustomData/train/seq01/blur/0001.png
~/Research/dataset/CustomData/train/seq01/sharp/0001.png