How to train deep learning network on own dataset

I have tried to train the TSAN network on other dataset. TSAN code is available on below link:
I have tried to train the TSAN network on other dataset. TSAN code is available on below link:

For that I have made folder named “dataset”. In dataset folder, two sub-folders named “DIV2K_train_HR” and “DIV2K_train_LR_bicubic” are created under DIV2K folder and HR and LR images are stored in the respective folders. In option.py code, I have changed the path: parser.add_argument(’–dir_data’, type=str, default=‘dataset/DIV2K/’, help=‘dataset directory’)

But, while compiling the train code using this following command: python main.py --template TSAN --save TSAN_X2 --scale 2 --reset --save_results --patch_size 96 --ext sep_reset
I got the following error.

%====================================================================
this name DIV2K
Traceback (most recent call last):
File “main_1.py”, line 12, in
loader = data.Data(args)
File “E:\Deep_learning\TSAN\TSAN_patternnet_test\Train\data_init_.py”, line 11, in init
trainset = getattr(module_train, args.data_train)(args)
File “E:\Deep_learning\TSAN\TSAN_patternnet_test\Train\data\div2k.py”, line 7, in init
args, name=name, train=train, benchmark=benchmark
File “E:\Deep_learning\TSAN\TSAN_patternnet_test\Train\data\srdata.py”, line 24, in init
data_range = [r.split(’-’) for r in args.data_range.split(’/’)]
AttributeError: ‘Namespace’ object has no attribute ‘data_range’

Please help me on this regard.

I couldn’t find --data-range from the arguments.
It might be modified.

@thecho7 In the option.py, data_range argument is not defined. I have defined the data_range in such way:
parser.add_argument(’–data_range’, type=str, default=‘1-2/3-4’, help=‘train/test data range’)

I have kept 4 images in DIV2K HR and LR folder. Batch size I have considered only 1, but now I am getting this error:
Traceback (most recent call last):
File “main_1.py”, line 12, in
loader = data.Data(args)
File “E:\Deep_learning\TSAN\TSAN_patternnet_test\Train\data_init_.py”, line 11, in init
trainset = getattr(module_train, args.data_train)(args)
File “E:\Deep_learning\TSAN\TSAN_patternnet_test\Train\data\div2k.py”, line 7, in init
args, name=name, train=train, benchmark=benchmark
File “E:\Deep_learning\TSAN\TSAN_patternnet_test\Train\data\srdata.py”, line 87, in init
= args.test_every // (len(self.images_hr) // args.batch_size)
ZeroDivisionError: integer division or modulo by zero

Make sure self.dir_hr in line 92 indicates the directory which contains the .png images inside it.

self.dir_hr
|- 1.png
|- 2.png