Giter VIP home page Giter VIP logo

Comments (7)

nicolai256 avatar nicolai256 commented on July 26, 2024 1

that worked, thanks!

from stylegan-nada.

rinongal avatar rinongal commented on July 26, 2024

The .pt models are pytorch checkpoints, they'll work with rosinality's stylegan2 code but not with the official implementations.

If you're working with SG3, you should just save the model as we do in this if block. This produces a pkl checkpoint that you can then use with the official SG3 code.

from stylegan-nada.

nicolai256 avatar nicolai256 commented on July 26, 2024

The .pt models are pytorch checkpoints, they'll work with rosinality's stylegan2 code but not with the official implementations.

If you're working with SG3, you should just save the model as we do in this if block. This produces a pkl checkpoint that you can then use with the official SG3 code.

when i try to use the generated pkl in stylegan3 it gives me an error (it only exports the save_intervals, not the actual trained model (training_iterations))
stylegan3 error =

Loading networks from "/content/drive/MyDrive/000150.pkl"...
Traceback (most recent call last):
  File "/content/drive/MyDrive/WIP/stylegan3/gen_images.py", line 143, in <module>
    generate_images() # pylint: disable=no-value-for-parameter
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/content/drive/MyDrive/WIP/stylegan3/gen_images.py", line 108, in generate_images
    G = legacy.load_network_pkl(f)['G_ema'].to(device) # type: ignore
  File "/content/drive/MyDrive/WIP/stylegan3/legacy.py", line 40, in load_network_pkl
    assert isinstance(data['G'], torch.nn.Module)
KeyError: 'G'

from stylegan-nada.

rinongal avatar rinongal commented on July 26, 2024

What StyleGAN3 script are you trying to run? If it's one of the generation scripts, could you try to change the loading code from:

with dnnlib.util.open_url(network_pkl) as f:
    G = legacy.load_network_pkl(f)['G_ema'].to(device)

to:

with dnnlib.util.open_url(network_pkl) as f:
    G = pickle.load(f)['G_ema'].to(device)

and let me know if that works?
You may also have to import pickle

from stylegan-nada.

rinongal avatar rinongal commented on July 26, 2024

Glad to hear. Closing the issue. Feel free to re-open or open a new issue if you need more help.

from stylegan-nada.

nicolai256 avatar nicolai256 commented on July 26, 2024

it seems like the colab only saves the previous save_interval, for example if i put the number of save_interval on for example 400 and training_iterations on 800 it only seems to save 000400.pkl and not 000800.pkl, how do i fix this? the model definitely exists somewhere because i can generate pictures with it but it doesn't appear anywhere

from stylegan-nada.

rinongal avatar rinongal commented on July 26, 2024

Set the training_iterations to 801 and it should work get you that last checkpoint

from stylegan-nada.

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.