cuiaiyu / dressing-in-order

(ICCV'21) Official code of "Dressing in Order: Recurrent Person Image Generation for Pose Transfer, Virtual Try-on and Outfit Editing" by Aiyu Cui, Daniel McKee and Svetlana Lazebnik
https://cuiaiyu.github.io/dressing-in-order
Other
513 stars 127 forks source link

Train on last stage error (KeyError: 'block0.model.1.weight') #37

Closed kieutrongthien closed 2 years ago

kieutrongthien commented 2 years ago

I'm running command sh ./scripts/run_train.sh . Everything is fine until last train run, below is my last train in file run_train.sh and error image:

python train.py --model dior \ --name $NAME --dataroot $DATAROOT \ --batch_size 8 --lr 1e-5 --init_type orthogonal \ --loss_coe_seg 0.1 \ --netG $NET_G --ngf $NGF \ --netD gfla --ndf 64 --n_layers_D 4 \ --n_epochs 240002 --n_epochs_decay 60000 --lr_update_unit 4000 \ --print_freq 200 --display_freq 10000 --save_epoch_freq 10000 --save_latest_freq 2000 \ --n_cpus 16 --gpu_ids 0,1,2,3 --continue_train \ --epoch iter_160000 --epoch_count 160001 \ --flownet_path $PRETRAINED_FLOWNET_PATH \ --random_rate 0.8 --perturb

Screen Shot 2022-02-16 at 01 14 11
cuiaiyu commented 2 years ago

That is a pytorch version problem to load weights of Spectrum Norm Module (part of the discriminator).

Try check solution from forum like https://discuss.pytorch.org/t/fail-to-load-parameters-with-spectral-norm/36903

kieutrongthien commented 2 years ago

Solved by commend line 313 at file models/base_model.py .

From: del state_dict._metadata

To: #del state_dict._metadata