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

sr3 network #58

Open
ehfo0888 opened this issue Nov 9, 2022 · 2 comments
Open

sr3 network #58

ehfo0888 opened this issue Nov 9, 2022 · 2 comments

Comments

@ehfo0888
Copy link

ehfo0888 commented Nov 9, 2022

Hello,

I tried to run the inpainting.json with sr3(I changed from guided_diffusion to sr3 in the config file) but I got the following error:

praser.py", line 49, in init_obj
    raise NotImplementedError('{} [{:s}() form {:s}] not recognized.'.format(init_type, class_name, file_name))
NotImplementedError: Network [Network() form models.network] not recognized.

does sr3 works?

@Janspiry
Copy link
Owner

Maybe there are some minor problems, can you provide a more detailed log?

@pstorozenko
Copy link

I encountered the same issue and found the solution.
If you scroll a bit the error message, you will find there's a problem with UNet initialization.
This is because UNet in guided_diffusion and in sr3 has different UNet and they require different inputs.
You should adjust the config so it's setting sr3 UNet initialization parameters:

class UNet(nn.Module):
def __init__(
self,
in_channel=6,
out_channel=3,
inner_channel=32,
norm_groups=32,
channel_mults=(1, 2, 4, 8, 8),
attn_res=(8),
res_blocks=3,
dropout=0,
with_noise_level_emb=True,
image_size=128
):

For example you could try setting config json as:

...
"module_name": "sr3", // sr3 | guided_diffusion
"unet": {
    "in_channel": 6,
    "out_channel": 3,
    "inner_channel": 64,
    "norm_groups": 16,
    "channel_mults": [
        1,
        2,
        4,
        8,
        // 8,
        // 16,
        16
    ],
    "attn_res": [
        8
        // 16
    ],
    "res_blocks": 1,
    "dropout": 0,
    "image_size": 256
},
...

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