mit-han-lab / gan-compression

[CVPR 2020] GAN Compression: Efficient Architectures for Interactive Conditional GANs
Other
1.1k stars 148 forks source link

"Once-for-all" Network Training Problem #108

Closed saijo0404 closed 1 year ago

saijo0404 commented 1 year ago
#!/usr/bin/env bash
python train_supernet.py --dataroot database/edges2shoes-r \
  --supernet resnet \
  --log_dir logs/pix2pix/edges2shoes-r/supernet \
  --batch_size 4 \
  --restore_teacher_G_path logs/pix2pix/edges2shoes-r/train/checkpoints/latest_net_G.pth \
  --restore_student_G_path logs/pix2pix/edges2shoes-r/distill/checkpoints/latest_net_G.pth \
  --restore_D_path logs/pix2pix/edges2shoes-r/distill/checkpoints/latest_net_D.pth \
  --real_stat_path real_stat/edges2shoes-r_B.npz \
  --nepochs 10 --nepochs_decay 30 \
  --teacher_ngf 64 --student_ngf 48 \
  --config_set channels-48 --meta_path datasets/metas/edges2shoes-r/train1.meta \
    --teacher_netG resnet_9blocks \
  --student_netG 

Hello, I used this bash to training "Once-for-all" Network, but I don't know what is there in the parameter --student_netG that I can use? My restore_teacher_G, restore_student_G and restore_D_path are use resnet_9blocks.

lmxyy commented 1 year ago

Hi, the student_netG should be a supernet architecture. Currently, we only support super_mobile_resnet_9blocks. So I guess what you could do is follow the Fast GAN Compression tutorial to directly use the resnet_9blocks teacher to train a `super_mobile_resnet_9blocks once-for-all network, or train a mobile_resnet_9blocks mobile teacher (or use our pre-trained one) and redistill a mobile_resnet_9blocks student. I suggest the first one.

saijo0404 commented 1 year ago

ok, thank you so much. I try do this.