Palette-Image-to-Image-Diffusion-Models icon indicating copy to clipboard operation
Palette-Image-to-Image-Diffusion-Models copied to clipboard

sr3 network

Open ehfo0888 opened this issue 2 years ago • 2 comments

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?

ehfo0888 avatar Nov 09 '22 17:11 ehfo0888

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

Janspiry avatar Dec 23 '22 13:12 Janspiry

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:

https://github.com/Janspiry/Palette-Image-to-Image-Diffusion-Models/blob/136b29f58d0af6e5db9f3655d2891f5a855fcdaa/models/sr3_modules/unet.py#L6-L19

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
},
...

pstorozenko avatar Jan 17 '23 11:01 pstorozenko