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

Real-CUGAN pro models are saved incorrectly #89

Closed
RunDevelopment opened this issue Dec 27, 2023 · 2 comments · Fixed by #119
Closed

Real-CUGAN pro models are saved incorrectly #89

RunDevelopment opened this issue Dec 27, 2023 · 2 comments · Fixed by #119
Labels
bug Something isn't working

Comments

@RunDevelopment
Copy link
Member

As explained here, Real-CUGAN pro models have a weird trick to them. The authors added a pro key to the state dict, and that is the only difference to regular Real-CUGAN models. The issue with this pro key is that it is not part of the architecture itself. This means that saving a pro model will not include the pro key. The goal of this issue is to find a solution to this problem.


@joeyballentine suggested the following solution:

Maybe we could have something like the call API where we have descriptor methods for saving that are model specific?

My response:

[...] the issue with that is that we would have 2 (potentially) different state dicts per model. One state dict of the model itself (model_desc.model.state_dict()) and the modified state dict of the new API.

@RunDevelopment RunDevelopment added the bug Something isn't working label Dec 27, 2023
@joeyballentine
Copy link
Member

The issue with this pro key is that it is not part of the architecture itself.

Could we just make it part of the architecture itself?

@RunDevelopment
Copy link
Member Author

Good idea. The official repo sets pro to the int 1, but it doesn't actually check that value, it only checks whether the key exists. So we have a tensor (size [1]) and assign it to the pro field. PyTorch would then save this tensor just like any other tensor and add the pro key we need to the state dict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants