stylegan2-pytorch icon indicating copy to clipboard operation
stylegan2-pytorch copied to clipboard

How can it work on my own dataset?

Open Yugt4732 opened this issue 4 years ago • 3 comments

There are about 20k pieces photo, and the resolution is 1024*1024. How can I train network? An AssertionError:assert isinstance(lambd, types.LambdaType). What is the process if I use my own dataset?

Yugt4732 avatar Oct 12 '20 06:10 Yugt4732

@Yugt4732 could you paste the full error trace?

lucidrains avatar Oct 12 '20 16:10 lucidrains

Here's the error I met.


Traceback (most recent call last): File "/home/momobot/anaconda3/envs/train/bin/stylegan2_pytorch", line 8, in sys.exit(main()) File "/home/momobot/anaconda3/envs/train/lib/python3.6/site-packages/stylegan2_pytorch/cli.py", line 157, in main fire.Fire(train_from_folder) File "/home/momobot/anaconda3/envs/train/lib/python3.6/site-packages/fire/core.py", line 138, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File "/home/momobot/anaconda3/envs/train/lib/python3.6/site-packages/fire/core.py", line 468, in _Fire target=component.name) File "/home/momobot/anaconda3/envs/train/lib/python3.6/site-packages/fire/core.py", line 672, in _CallAndUpdateTrace component = fn(*varargs, **kwargs) File "/home/momobot/anaconda3/envs/train/lib/python3.6/site-packages/stylegan2_pytorch/cli.py", line 148, in train_from_folder run_training(0, 1, model_args, data, load_from, new, num_train_steps, name) File "/home/momobot/anaconda3/envs/train/lib/python3.6/site-packages/stylegan2_pytorch/cli.py", line 56, in run_training model.set_data_src(data) File "/home/momobot/anaconda3/envs/train/lib/python3.6/site-packages/stylegan2_pytorch/stylegan2_pytorch.py", line 757, in set_data_src self.dataset = Dataset(folder, self.image_size, transparent = self.transparent, aug_prob = self.dataset_aug_prob) File "/home/momobot/anaconda3/envs/train/lib/python3.6/site-packages/stylegan2_pytorch/stylegan2_pytorch.py", line 281, in init transforms.Lambda(partial(resize_to_minimum_size, image_size)), File "/home/momobot/anaconda3/envs/train/lib/python3.6/site-packages/torchvision/transforms/transforms.py", line 279, in init assert isinstance(lambd, types.LambdaType) AssertionError

Yugt4732 avatar Oct 19 '20 09:10 Yugt4732

Maybe you can check if you have PNG files between the JPG, or maybe some of the images are corrupted. Did you curated the dataset?

vio-codes avatar Oct 24 '20 08:10 vio-codes