Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

projector error #3

Open
JianfengYin opened this issue Feb 10, 2022 · 1 comment
Open

projector error #3

JianfengYin opened this issue Feb 10, 2022 · 1 comment

Comments

@JianfengYin
Copy link

JianfengYin commented Feb 10, 2022

Hi,

When try to project an image to latent space by running " python projector.py --outdir=./ --target=../images/xxx.png --posefile=../images/pose-annotations.csv --network=https://nvlabs-fi-cdn.nvidia.com/stylegan2-ada-pytorch/pretrained/ffhq.pkl",

I got an error like this:

TypeError: forward() takes 2 positional arguments but 3 were given

stack is:


Traceback (most recent call last):
  File "/opt/conda/lib/python3.8/pdb.py", line 1704, in main
    pdb._runscript(mainpyfile)
  File "/opt/conda/lib/python3.8/pdb.py", line 1573, in _runscript
    self.run(statement)
  File "/opt/conda/lib/python3.8/bdb.py", line 580, in run
    exec(cmd, globals, locals)
  File "<string>", line 1, in <module>
  File "/workspace/TryOnGAN/projector.py", line 9, in <module>
    """Project given image to the latent space of pretrained network pickle."""
  File "/opt/conda/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/opt/conda/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/opt/conda/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/conda/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/workspace/TryOnGAN/projector.py", line 227, in run_projection
    projected_w_steps = project(
  File "/workspace/TryOnGAN/projector.py", line 97, in project
    synth_images = G.synthesis(ws, pose, ret_pose=False, noise_mode='const')
  File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 744, in _call_impl
    result = self.forward(*input, **kwargs)
TypeError: forward() takes 2 positional arguments but 3 were given

Any idea what is going wrong?
Thanks.

@yukistavailable
Copy link

yukistavailable commented May 29, 2022

The solution would be to use a network for PC such as PC-add-scratch-network-snapshot-002040.pkl.
You can't use the network for stylegan2. You can find pre-trained networks for TryOnGAN here. https://drive.google.com/drive/folders/1_GxdMeMDhGcFlGowQg10dANO1liS0v4Z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy