InstColorization icon indicating copy to clipboard operation
InstColorization copied to clipboard

why is my generated result image is also gray?

Open honeytidy opened this issue 4 years ago • 5 comments

I am running with the test code and got all result also grays. It is like that: image My pytorch vision is 1.5.

honeytidy avatar Jun 02 '20 11:06 honeytidy

Do you follow the setting in the colab notebook? You can run sh scripts/test_mask.sh to get colorized results.

ericsujw avatar Jun 02 '20 12:06 ericsujw

Yes, I do. infer box first and then run fusion. But I did this on my windows and cpu model. Do it matter. And I as you can see that color seems on a small area. How to debug that? image

honeytidy avatar Jun 16 '20 02:06 honeytidy

Yes, I do. infer box first and then run fusion. But I did this on my windows and cpu model. Do it matter. And I as you can see that color seems on a small area. How to debug that? image

Please have a look at PR #12. The pretrained weights may not be loaded.

thelastlin avatar Nov 01 '20 07:11 thelastlin

On Linux, CPU is also too, it is very strange, but GPU works well.

delldu avatar Nov 25 '20 14:11 delldu

https://github.com/ericsujw/InstColorization/blob/master/models/fusion_model.py#L108

        GF_state_dict_temp ={}
        for k,v in GF_state_dict.items():
            if k.startswith('module'):
                GF_state_dict_temp[k[7:]] = v
            else:
                GF_state_dict_temp[k] = v
        GF_state_dict = GF_state_dict_temp

        G_state_dict_temp ={}
        for k,v in G_state_dict.items():
            if k.startswith('module'):
                G_state_dict_temp[k[7:]] = v
            else:
                G_state_dict_temp[k] = v
        G_state_dict = G_state_dict_temp

        GComp_state_dict_temp ={}
        for k,v in GComp_state_dict.items():
            if k.startswith('module'):
                GComp_state_dict_temp[k[7:]] = v
            else:
                GComp_state_dict_temp[k] = v
        GComp_state_dict = GComp_state_dict_temp

        self.netGF.load_state_dict(GF_state_dict, strict=True)
        self.netG.load_state_dict(G_state_dict, strict=True)
        self.netGComp.load_state_dict(GComp_state_dict, strict=True)

sysuzyq avatar Apr 01 '21 09:04 sysuzyq