Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

train with custom dataset #33

Open
jstak0804 opened this issue Sep 30, 2022 · 0 comments
Open

train with custom dataset #33

jstak0804 opened this issue Sep 30, 2022 · 0 comments

Comments

@jstak0804
Copy link

jstak0804 commented Sep 30, 2022

Hello I'm trying to train model with my custom datasets
but, it shows error below.

TypeError: Caught TypeError in DataLoader worker process 0.

TypeError: object of type 'module' has no len()
I saw past's Issue so I edit data_loader as

self.noise_imgs = [os.path.join(root, name)
for root, dirs, files in os.walk(base)
for name in files
if name.endswith(('png'))]

I think It shows problem in noise part
espacially here

    if self.opt['phase'] == 'train':
        print(self.opt)
        # add noise to LR during train
        if self.opt['aug'] and 'noise' in self.opt['aug']:
            print(len(self.noises))
            noise = self.noises[np.random.randint(0, len(self.noises))]

            img_LQ = torch.clamp(img_LQ + noise, 0, 1)

and this is my yml file that relates with train

name: Corrupted_noise
use_tb_logger: true
model: srgan
distortion: sr
scale: 4
gpu_ids: [4]

datasets

datasets:
train:
name: train
mode: LQGT
aug: noise
scale: 4
noise_data: /media/soft/20EE2B81EE2B4DFA/Tak/Real-SR/codes/open/train/Corrupted_noise
dataroot_GT: /media/soft/20EE2B81EE2B4DFA/Tak/Real-SR/codes/open/train/generated/tdsr/HR
dataroot_LQ: /media/soft/20EE2B81EE2B4DFA/Tak/Real-SR/codes/open/train/generated/tdsr/LR
use_shuffle: true
n_workers: 6 # per GPU
batch_size: 16
GT_size: 128
use_flip: true
use_rot: true
color: RGB

I need your help...!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant