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

Google Colab demo #17

Open
josephrocca opened this issue Nov 15, 2021 · 2 comments
Open

Google Colab demo #17

josephrocca opened this issue Nov 15, 2021 · 2 comments

Comments

@josephrocca
Copy link
Contributor

josephrocca commented Nov 15, 2021

I'm been playing around trying to create a minimal Google Colab demo for this repository, but am running into some error messages that you can see here:

As you can see, the ImageNet inference command (same as in README) throws an error like this:

RuntimeError: Error(s) in loading state_dict for InpaintGenerator_5:
	Missing key(s) in state_dict: "encoder.1.weight", "encoder.1.bias", "encoder.3.weight", ...............
	Unexpected key(s) in state_dict: "module.encoder.1.weight", "module.encoder.1.bias", ...............

I haven't dug into the other (FFHQ) error yet - it says something about transparency, which may be a mistake on my part with preparing the input image and mask (image, mask).

Thanks for your work on this repo and publicly releasing the code and pre-trained models! Can't wait to try it out.

@gigadeplex
Copy link

gigadeplex commented Jul 14, 2022

Notice the "module" in "module.encoder.1.weight" and notice how it's not in the model you're trying to load it to. That "module" prefix just means the model that was used to create those weights was using nn.DataParallel. Either go to comment the if statement in Guided_Upsample/models.py line around 77 or just map the weights yourself.

@ntbjx
Copy link

ntbjx commented Aug 18, 2022

Notice the "module" in "module.encoder.1.weight" and notice how it's not in the model you're trying to load it to. That "module" prefix just means the model that was used to create those weights was using nn.DataParallel. Either go to comment the if statement in Guided_Upsample/models.py line around 77 or just map the weights yourself.

Thanks a lot for your comment, after I removed the if statement on line 71, the error went away.

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

3 participants