Giter Club home page Giter Club logo

Comments (6)

xinntao avatar xinntao commented on May 22, 2024 6

@icoric4
The training setting is similar, but

  1. we remove the component loss
  2. we use more data and data with higher quality
  3. the training network structure is not the same as the inference network structure

from gfpgan.

xinntao avatar xinntao commented on May 22, 2024

@icoric4 Finetuning the https://github.com/TencentARC/GFPGAN/releases/download/v0.2.0/GFPGANCleanv1-NoCE-C2.pth has not been supported yet. As this model is converted from another model (which is not released.)

I will add the model, but it may take much time ~

from gfpgan.

icoric4 avatar icoric4 commented on May 22, 2024

Thanks!

from gfpgan.

icoric4 avatar icoric4 commented on May 22, 2024

Hello, I have another question.

When training from scratch a model like this one https://github.com/TencentARC/GFPGAN/releases/download/v0.2.0/GFPGANCleanv1-NoCE-C2.pth,

could you share the training settings you have used to train it, similar to this?

# training settings
train:
  optim_g:
    type: Adam
    lr: !!float 2e-3
  optim_d:
    type: Adam
    lr: !!float 2e-3
  optim_component:
    type: Adam
    lr: !!float 2e-3

  scheduler:
    type: MultiStepLR
    milestones: [600000, 700000]
    gamma: 0.5

  total_iter: 800000
  warmup_iter: -1  # no warm up

  # losses
  # pixel loss
  pixel_opt:
    type: L1Loss
    loss_weight: !!float 1e-1
    reduction: mean
  # L1 loss used in pyramid loss, component style loss and identity loss
  L1_opt:
    type: L1Loss
    loss_weight: 1
    reduction: mean

  # image pyramid loss
  pyramid_loss_weight: 1
  remove_pyramid_loss: 50000
  # perceptual loss (content and style losses)
  perceptual_opt:
    type: PerceptualLoss
    layer_weights:
      # before relu
      'conv1_2': 0.1
      'conv2_2': 0.1
      'conv3_4': 1
      'conv4_4': 1
      'conv5_4': 1
    vgg_type: vgg19
    use_input_norm: true
    perceptual_weight: !!float 1
    style_weight: 50
    range_norm: true
    criterion: l1
  # gan loss
  gan_opt:
    type: GANLoss
    gan_type: wgan_softplus
    loss_weight: !!float 1e-1
  # r1 regularization for discriminator
  r1_reg_weight: 10
  # facial component loss
  gan_component_opt:
    type: GANLoss
    gan_type: vanilla
    real_label_val: 1.0
    fake_label_val: 0.0
    loss_weight: !!float 1
  comp_style_weight: 200
  # identity loss
  identity_weight: 10

  net_d_iters: 1
  net_d_init_iters: 0
  net_d_reg_every: 16

from gfpgan.

timfu248 avatar timfu248 commented on May 22, 2024

你好,如果我想训练 type: GFPGANv1Clean,该怎样获取正确的pre-trained stylegan2 model呢?

如此设置时 decoder_load_path: experiments/pretrained_models/StyleGAN2_512_Cmul1_FFHQ_B12G4_scratch_800k.pth
会报如下错误:

RuntimeError: Error(s) in loading state_dict for StyleGAN2GeneratorCSFT:
Missing key(s) in state_dict: "style_mlp.9.weight", "style_mlp.9.bias", "style_mlp.11.weight", "style_mlp.11.bias", "style_mlp.13.weight", "style_mlp.13.bias", "style_mlp.15.weight", "style_mlp.15.bias", "style_conv1.bias", "style_convs.0.bias", "style_convs.1.bias", "style_convs.2.bias", "style_convs.3.bias", "style_convs.4.bias", "style_convs.5.bias", "style_convs.6.bias", "style_convs.7.bias", "style_convs.8.bias", "style_convs.9.bias", "style_convs.10.bias", "style_convs.11.bias", "style_convs.12.bias", "style_convs.13.bias".
Unexpected key(s) in state_dict: "style_mlp.2.weight", "style_mlp.2.bias", "style_mlp.4.weight", "style_mlp.4.bias", "style_mlp.6.weight", "style_mlp.6.bias", "style_mlp.8.weight", "style_mlp.8.bias", "style_conv1.activate.bias", "style_convs.0.activate.bias", "style_convs.1.activate.bias", "style_convs.2.activate.bias", "style_convs.3.activate.bias", "style_convs.4.activate.bias", "style_convs.5.activate.bias", "style_convs.6.activate.bias", "style_convs.7.activate.bias", "style_convs.8.activate.bias", "style_convs.9.activate.bias", "style_convs.10.activate.bias", "style_convs.11.activate.bias", "style_convs.12.activate.bias", "style_convs.13.activate.bias".

from gfpgan.

laodar avatar laodar commented on May 22, 2024

你好,如果我想训练 type: GFPGANv1Clean,该怎样获取正确的pre-trained stylegan2 model呢?

如此设置时 decoder_load_path: experiments/pretrained_models/StyleGAN2_512_Cmul1_FFHQ_B12G4_scratch_800k.pth 会报如下错误:

RuntimeError: Error(s) in loading state_dict for StyleGAN2GeneratorCSFT: Missing key(s) in state_dict: "style_mlp.9.weight", "style_mlp.9.bias", "style_mlp.11.weight", "style_mlp.11.bias", "style_mlp.13.weight", "style_mlp.13.bias", "style_mlp.15.weight", "style_mlp.15.bias", "style_conv1.bias", "style_convs.0.bias", "style_convs.1.bias", "style_convs.2.bias", "style_convs.3.bias", "style_convs.4.bias", "style_convs.5.bias", "style_convs.6.bias", "style_convs.7.bias", "style_convs.8.bias", "style_convs.9.bias", "style_convs.10.bias", "style_convs.11.bias", "style_convs.12.bias", "style_convs.13.bias". Unexpected key(s) in state_dict: "style_mlp.2.weight", "style_mlp.2.bias", "style_mlp.4.weight", "style_mlp.4.bias", "style_mlp.6.weight", "style_mlp.6.bias", "style_mlp.8.weight", "style_mlp.8.bias", "style_conv1.activate.bias", "style_convs.0.activate.bias", "style_convs.1.activate.bias", "style_convs.2.activate.bias", "style_convs.3.activate.bias", "style_convs.4.activate.bias", "style_convs.5.activate.bias", "style_convs.6.activate.bias", "style_convs.7.activate.bias", "style_convs.8.activate.bias", "style_convs.9.activate.bias", "style_convs.10.activate.bias", "style_convs.11.activate.bias", "style_convs.12.activate.bias", "style_convs.13.activate.bias".

@timfu248 有解决吗兄弟,目前是不是只能微调GFPGANv1.pth呀

from gfpgan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.