menyifang / ADGAN

The Implementation of paper "Controllable Person Image Synthesis with Attribute-Decomposed GAN" CVPR 2020 (Oral); Pose and Appearance Attributes Transfer;
473 stars 90 forks source link

Pretrained model not generating proper images #6

Closed JiamingFB closed 4 years ago

JiamingFB commented 4 years ago

Hi,

I'm trying to generate images with the pretrained model and the provided preprocessed dataset, but I'm only getting random pixels. I wonder if I'm missing anything in my setup not mentioned in the README file. Really appreciate your help!

Sample output: fashionMENJackets_Vestsid0000724701_2side jpg___fashionMENJackets_Vestsid0000724701_1front jpg_vis

My test.sh: python test.py \ --dataroot deepfashion \ --dirSem deepfashion \ --pairLst deepfashion/fashion-resize-pairs-test.csv \ --checkpoints_dir ./checkpoints \ --results_dir ./results \ --name fashion_AdaGen_sty512_nres8_lre3_SS_fc_vgg_cxloss_ss_merge3 \ --model adgan \ --phase test \ --dataset_mode keypoint \ --norm instance \ --batchSize 1 \ --resize_or_crop no \ --gpu_ids 0 \ --BP_input_nc 18 \ --no_flip \ --which_model_netG ADGen \ --which_epoch 800

My folder structure: ADGAN ├── checkpoints │   ├── fashion_AdaGen_sty512_nres8_lre3_SS_fc_vgg_cxloss_ss_merge3 │   │   ├── 1000_net_netG.pth │   │   ├── 800_net_netG.pth │   │   ├── loss_log.txt │   │   ├── opt.txt ├── cx ├── data ├── deepfashion │   ├── fashion-resize-annotation-test.csv │   ├── fashion-resize-annotation-train.csv │   ├── fashion-resize-pairs-test.csv │   ├── fashion-resize-pairs-train.csv │   ├── resized │   ├── semantic_merge2 │   ├── semantic_merge3 │   ├── test │   ├── testK │   ├── test.lst │   ├── train │   ├── trainK │   ├── train.lst │   ├── vgg19-dcbb9e9d.pth │   └── vgg_conv.pth ├── gif ├── losses ├── models ├── options ├── README.md ├── scripts ├── ssd_score ├── test.py ├── tool ├── train.py └── util

I also fixed a hardcoded path in model_adgen.py locally.

menyifang commented 4 years ago

Hi,

I'm trying to generate images with the pretrained model and the provided preprocessed dataset, but I'm only getting random pixels. I wonder if I'm missing anything in my setup not mentioned in the README file. Really appreciate your help!

Sample output: fashionMENJackets_Vestsid0000724701_2side jpg___fashionMENJackets_Vestsid0000724701_1front jpg_vis

My test.sh: python test.py --dataroot deepfashion --dirSem deepfashion --pairLst deepfashion/fashion-resize-pairs-test.csv --checkpoints_dir ./checkpoints --results_dir ./results --name fashion_AdaGen_sty512_nres8_lre3_SS_fc_vgg_cxloss_ss_merge3 --model adgan --phase test --dataset_mode keypoint --norm instance --batchSize 1 --resize_or_crop no --gpu_ids 0 --BP_input_nc 18 --no_flip --which_model_netG ADGen --which_epoch 800

My folder structure: ADGAN ├── checkpoints │   ├── fashion_AdaGen_sty512_nres8_lre3_SS_fc_vgg_cxloss_ss_merge3 │   │   ├── 1000_net_netG.pth │   │   ├── 800_net_netG.pth │   │   ├── loss_log.txt │   │   ├── opt.txt ├── cx ├── data ├── deepfashion │   ├── fashion-resize-annotation-test.csv │   ├── fashion-resize-annotation-train.csv │   ├── fashion-resize-pairs-test.csv │   ├── fashion-resize-pairs-train.csv │   ├── resized │   ├── semantic_merge2 │   ├── semantic_merge3 │   ├── test │   ├── testK │   ├── test.lst │   ├── train │   ├── trainK │   ├── train.lst │   ├── vgg19-dcbb9e9d.pth │   └── vgg_conv.pth ├── gif ├── losses ├── models ├── options ├── README.md ├── scripts ├── ssd_score ├── test.py ├── tool ├── train.py └── util

I also fixed a hardcoded path in model_adgen.py locally.

Hi @JiamingFB, you can try to use two GPUs for 'gpu_ids'. The provided model is trained with two GPUs and the single mode will make the layer name sightly different from the original one.

JiamingFB commented 4 years ago

Hi @menyifang,

Thank you very much! It works after changing to two GPUs :)

Here is the working script for reference: python test.py \ --dataroot deepfashion \ --dirSem deepfashion \ --pairLst deepfashion/fashion-resize-pairs-test.csv \ --checkpoints_dir ./checkpoints \ --results_dir ./results \ --name fashion_AdaGen_sty512_nres8_lre3_SS_fc_vgg_cxloss_ss_merge3 \ --model adgan \ --phase test \ --dataset_mode keypoint \ --norm instance \ --batchSize 1 \ --resize_or_crop no \ --gpu_ids 0,1 \ --BP_input_nc 18 \ --no_flip \ --which_model_netG ADGen \ --which_epoch 800

mkemka commented 4 years ago

Thank you for answering this question @menyifang. Is it possible to run this on a single gpu or cpu? When I change the gpuids the error is that there is no GPU with ID 1

mkemka commented 4 years ago

Hi @JiamingFB - do you know what the difference is in the layer names between the multi and single gpu options? I am unable to use a multi-gpu machine so I am trying to test on a single and getting the same images you were getting.

EDIT: Sorry to bother you. I realised if I change the gpu to 0,0 then it will work.

ludysama commented 3 years ago

thanks for your tips, it really helps me a lot

maidang-zc commented 10 months ago

Hi @menyifang,

Thank you very much! It works after changing to two GPUs :)

Here is the working script for reference: python test.py --dataroot deepfashion --dirSem deepfashion --pairLst deepfashion/fashion-resize-pairs-test.csv --checkpoints_dir ./checkpoints --results_dir ./results --name fashion_AdaGen_sty512_nres8_lre3_SS_fc_vgg_cxloss_ss_merge3 --model adgan --phase test --dataset_mode keypoint --norm instance --batchSize 1 --resize_or_crop no --gpu_ids 0,1 --BP_input_nc 18 --no_flip --which_model_netG ADGen --which_epoch 800

Hi,

I'm trying to generate images with the pretrained model and the provided preprocessed dataset, but I'm only getting random pixels. I wonder if I'm missing anything in my setup not mentioned in the README file. Really appreciate your help!

Sample output: fashionMENJackets_Vestsid0000724701_2side jpg___fashionMENJackets_Vestsid0000724701_1front jpg_vis

My test.sh: python test.py --dataroot deepfashion --dirSem deepfashion --pairLst deepfashion/fashion-resize-pairs-test.csv --checkpoints_dir ./checkpoints --results_dir ./results --name fashion_AdaGen_sty512_nres8_lre3_SS_fc_vgg_cxloss_ss_merge3 --model adgan --phase test --dataset_mode keypoint --norm instance --batchSize 1 --resize_or_crop no --gpu_ids 0 --BP_input_nc 18 --no_flip --which_model_netG ADGen --which_epoch 800

My folder structure: ADGAN ├── checkpoints │   ├── fashion_AdaGen_sty512_nres8_lre3_SS_fc_vgg_cxloss_ss_merge3 │   │   ├── 1000_net_netG.pth │   │   ├── 800_net_netG.pth │   │   ├── loss_log.txt │   │   ├── opt.txt ├── cx ├── data ├── deepfashion │   ├── fashion-resize-annotation-test.csv │   ├── fashion-resize-annotation-train.csv │   ├── fashion-resize-pairs-test.csv │   ├── fashion-resize-pairs-train.csv │   ├── resized │   ├── semantic_merge2 │   ├── semantic_merge3 │   ├── test │   ├── testK │   ├── test.lst │   ├── train │   ├── trainK │   ├── train.lst │   ├── vgg19-dcbb9e9d.pth │   └── vgg_conv.pth ├── gif ├── losses ├── models ├── options ├── README.md ├── scripts ├── ssd_score ├── test.py ├── tool ├── train.py └── util

I also fixed a hardcoded path in model_adgen.py locally.

hello,could you share your 1000_net_netG.pth and 800_net_netG.pth,I am a graduate researching this paper.However,I don't have enough quick GPU to process 800 and 1000 epoch