liyunsheng13 / BDL

MIT License
222 stars 30 forks source link

How to train CycleGAN with perceptual loss? #16

Open JiahuaDong opened 5 years ago

JiahuaDong commented 5 years ago

Thanks for sharing your code firstly. After reading your code and paper carefully, I still have some questions, how to train CycleGAN by bidirectional learning? My undestandings about that are shown as follows:

  1. Training CycleGAN with corresponding loss to get translated GTA images.
  2. BDL.py: Training segmentation network with translated GTA images and Cityscpes images
  3. SSL.py: Obtaining the pseudo labels for Cityscapes and fine-tuning the segmentation network
  4. Trainig CycleGAN with perceptual loss, while fixing the parameters of segmentation network.

Are my understanding right ? Thanks for your answers!

liyunsheng13 commented 5 years ago

Yes. You are right.

JiahuaDong commented 5 years ago

Could you share the code of training CylceGAN network with perceptual loss?? Thank you.

liyunsheng13 commented 5 years ago

The code has been uploaded to the folder named 'cyclegan'. You can download the original project for cyclegan from their website and merge the code I uploaded to it.

JiahuaDong commented 5 years ago

Thanks for your answers. I still have a questions about SSL.py. When running the SSL.py, I need restore the parameters from the SSL_step1 or SSL_step1. The files SSL_step1 and SSL_step2 are the saved optimal parameters in the process of training BDL.py?? If yes, how to select the optimal file when running BDL.py? The SSL_step1 and SSL_step1 are the finally saved files when running BDL.py?

liyunsheng13 commented 4 years ago

Sorry for the confusion. It is a bug and I just change it to deeplab.

On Thu, Jan 9, 2020 at 11:50 PM Sicheng Xu notifications@github.com wrote:

@liyunsheng13 https://github.com/liyunsheng13 ,hi, could you provide the deeplab_multi.py file?

https://github.com/liyunsheng13/BDL/blob/0b591ef007e738dceaad3aab9dfabc06b4fecdff/cyclegan/networks.py#L6 I wanna know which layers are used for semantic perceptual loss?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/liyunsheng13/BDL/issues/16?email_source=notifications&email_token=AEEVZTGDL5O35MPZ6QOZJW3Q5ASERA5CNFSM4IOWBME2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIS7ZYQ#issuecomment-572914914, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEEVZTCFLLPVOR3JAS74RJTQ5ASERANCNFSM4IOWBMEQ .

lucafei commented 3 years ago

hi, i have a question for the cyclegan training. If we get the translated image from trained cyclegan, how can we guarantee the label consistent with the translated image? Because the translated image is diffenrent with original, which maybe cause the inconsistent with corresponding label. Thank you in advance!