Code Monkey home page Code Monkey logo

Comments (1)

nightrain-vampire avatar nightrain-vampire commented on June 1, 2024

I have the official model weight trained from NVlabs,but when i want to convert it into genforce style,I encounter the issue as follow:

========================================
Loading source weights from `/data/user3/fewshot/stylegan2-ada-pytorch/training-runs/00000-retina-auto2-batch32/network-snapshot-004400.pkl` ...
Successfully loaded!
--------------------
Converting source weights (G) to target ...
Traceback (most recent call last):
  File "/data/user3/fewshot/genforce/convert_model.py", line 77, in <module>
    main()
  File "/data/user3/fewshot/genforce/convert_model.py", line 66, in main
    convert_stylegan2ada_pth_weight(src_weight_path=args.source_model_path,
  File "/data/user3/fewshot/genforce/converters/stylegan2ada_pth_converter.py", line 187, in convert_stylegan2ada_pth_weight
    assert tf_var_name in official_tf_to_pth_var_mapping
AssertionError

What happens? How can I solve it?

I solved it! The problem lies in stylegan2ada_pth_converter.py; In the official NVlabs stylegan2-ada-pytorch, the mapping_layers is 2 in the auto config, but in stylegan2ada_pth_converter.py, the mapping_layers is 8 as default.

G = build_model(gan_type=GAN_TPYE,
                    module='generator',
                    resolution=resolution,
                    z_space_dim=z_space_dim,
                    w_space_dim=w_space_dim,
                    label_size=label_size,
                    repeat_w=repeat_w,
                    mapping_layers=2,
                    image_channels=image_channels)
Gs = build_model(gan_type=GAN_TPYE,
                     module='generator',
                     resolution=resolution,
                     z_space_dim=z_space_dim,
                     w_space_dim=w_space_dim,
                     label_size=label_size,
                     repeat_w=repeat_w,
                     mapping_layers=2,
                     image_channels=image_channels)

Now the converter runs successfully!

from genforce.

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.