You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"No module named 'model'" when trying to run interactive.py #10
I have spent the last 5 hours trying to get this script to work assuming that it is something wrong on my end, but after reinstalling countless times I thought I would bring it up here to see if i could get some help. In SETUP.md for setting up stylegan2 it says to go to models/stylegan2/stylegan2-pytorch/op and run setup.py, however that directory does not exist, and so I was forced to skip that part of the setup, which I assume is causing this issue. The full error is as follows: Traceback (most recent call last): File "interactive.py", line 22, in <module> from models import get_instrumented_model File "/home/noah/ganspace-master/models/__init__.py", line 11, in <module> from .wrappers import * File "/home/noah/ganspace-master/models/wrappers.py", line 22, in <module> from . import stylegan2 File "/home/noah/ganspace-master/models/stylegan2/__init__.py", line 14, in <module> from model import Generator ModuleNotFoundError: No module named 'model'
I am also unsure as to how I am meant to load up my own .pt file, as with the normal PyTorch version of stylegan2 you are able to specify the file when you run the generate command
StyleGAN2 is included as a git submodule. You can download the submodules by running git submodule update --init --recursive.
As for loading your model: if you already have a pt file generated by Rosinality's stylegan2 implementation, then you only need to modify __init__() and download_checkpoint() in models/wrappers.py.
Ah thanks, I managed to get it up and running. Do you think you could explain what I need to modify it to? I don't quite understand how I am meant to change it
Oh i see! I didn't realise i was meant to upload the model to google drive. Issue fixed
Also if anyone has the "Unexpected key(s) in state_dict:" error, add "strict=False"to "self.model.load_state_dict([ckpt['g_ema'], strict=False)" in wrappers.py
Activity
harskish commentedon May 14, 2020
StyleGAN2 is included as a git submodule. You can download the submodules by running
git submodule update --init --recursive.As for loading your model: if you already have a pt file generated by Rosinality's stylegan2 implementation, then you only need to modify
__init__()anddownload_checkpoint()inmodels/wrappers.py.MineThingIssues commentedon May 15, 2020
Ah thanks, I managed to get it up and running. Do you think you could explain what I need to modify it to? I don't quite understand how I am meant to change it
MineThingIssues commentedon May 15, 2020
Oh i see! I didn't realise i was meant to upload the model to google drive. Issue fixed
Also if anyone has the "Unexpected key(s) in state_dict:" error, add "strict=False"to "self.model.load_state_dict([ckpt['g_ema'], strict=False)" in wrappers.py
Update SETUP.md