adobe-research / sam_inversion

[CVPR 2022] GAN inversion and editing with spatially-adaptive multiple latent layers
Other
171 stars 10 forks source link

No module named 'dnnlib' #1

Closed ariel415el closed 2 years ago

ariel415el commented 2 years ago

Hi I'm trying to run your code but It has an import whithout a mention in the dependencies and I get:

  File "src/sam_inv_optimization.py", line 132, in <module>
    net_G = load_generator(args.gan_type, args.gan_weights)
  File "/home/ariel/repos/sam_inversion/src/model_utils.py", line 29, in load_generator
    import dnnlib
ModuleNotFoundError: No module named 'dnnlib'

when trying to run src/sam_inv_optimization.py.

I figured this is a library related to StyleGan2. Do I need to clone or install some StyleGan repo in order to use your code? I tried installing stylegan2-pytorch from pip but it didn't help

abdul756 commented 2 years ago

Just clone the stylegan2-pytorch repo in src folder then append the path of stylegan2 repo in model_utils.py. It will work, if facing any issue let me know

GaParmar commented 2 years ago

Hi,

Thank you for pointing these out! Please also clone the following submodules here: https://github.com/adobe-research/sam_inversion/blob/master/.gitmodules