Giter VIP home page Giter VIP logo

Comments (3)

taesungp avatar taesungp commented on July 22, 2024

It is because the checkpoint model requires instance map. The number of input channel using instance map will be one larger than not using instance map. Please refer to this issue

from spade.

SaidaSaad avatar SaidaSaad commented on July 22, 2024

When I'm trying to run test.py with --no_instance flag, I get the following error (I tried this flag on COCO and Cityscapes checkpoints, and the error happens on both):

Traceback (most recent call last): File "test.py", line 19, in <module> model = Pix2PixModel(opt) File "D:\...path...\SPADE\models\pix2pix_model.py", line 26, in __init__ self.netG, self.netD, self.netE = self.initialize_networks(opt) File "D:\...path...\SPADE\models\pix2pix_model.py", line 98, in initialize_networks netG = util.load_network(netG, 'G', opt.which_epoch, opt) File "D:\...path...\SPADE\util\util.py", line 194, in load_network net.load_state_dict(weights) File "D:\...path...\Python\Python36\lib\site-packages\torch\nn\modules\module.py", line 769, in load_state_dict self.__class__.__name__, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for SPADEGenerator: size mismatch for fc.weight: copying a param with shape torch.Size([1024, 184, 3, 3]) from checkpoint, the shape in current model is torch.Size([1024, 183, 3, 3]). size mismatch for head_0.norm_0.mlp_shared.0.weight: copying a param with shape torch.Size([128, 184, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 183, 3, 3]). size mismatch for head_0.norm_1.mlp_shared.0.weight: copying a param with shape torch.Size([128, 184, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 183, 3, 3]). size mismatch for G_middle_0.norm_0.mlp_shared.0.weight: copying a param with shape torch.Size([128, 184, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 183, 3, 3]). size mismatch for G_middle_0.norm_1.mlp_shared.0.weight: copying a param with shape torch.Size([128, 184, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 183, 3, 3]). size mismatch for G_middle_1.norm_0.mlp_shared.0.weight: copying a param with shape torch.Size([128, 184, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 183, 3, 3]). size mismatch for G_middle_1.norm_1.mlp_shared.0.weight: copying a param with shape torch.Size([128, 184, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 183, 3, 3]). size mismatch for up_0.norm_0.mlp_shared.0.weight: copying a param with shape torch.Size([128, 184, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 183, 3, 3]). size mismatch for up_0.norm_1.mlp_shared.0.weight: copying a param with shape torch.Size([128, 184, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 183, 3, 3]). size mismatch for up_0.norm_s.mlp_shared.0.weight: copying a param with shape torch.Size([128, 184, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 183, 3, 3]). size mismatch for up_1.norm_0.mlp_shared.0.weight: copying a param with shape torch.Size([128, 184, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 183, 3, 3]). size mismatch for up_1.norm_1.mlp_shared.0.weight: copying a param with shape torch.Size([128, 184, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 183, 3, 3]). size mismatch for up_1.norm_s.mlp_shared.0.weight: copying a param with shape torch.Size([128, 184, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 183, 3, 3]). size mismatch for up_2.norm_0.mlp_shared.0.weight: copying a param with shape torch.Size([128, 184, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 183, 3, 3]). size mismatch for up_2.norm_1.mlp_shared.0.weight: copying a param with shape torch.Size([128, 184, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 183, 3, 3]). size mismatch for up_2.norm_s.mlp_shared.0.weight: copying a param with shape torch.Size([128, 184, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 183, 3, 3]). size mismatch for up_3.norm_0.mlp_shared.0.weight: copying a param with shape torch.Size([128, 184, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 183, 3, 3]). size mismatch for up_3.norm_1.mlp_shared.0.weight: copying a param with shape torch.Size([128, 184, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 183, 3, 3]). size mismatch for up_3.norm_s.mlp_shared.0.weight: copying a param with shape torch.Size([128, 184, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 183, 3, 3]).

Thank you for the code and the great work
I also got the same , I am using Input label maps (my own label maps but generated using model trained on COCO), Since instances maps is needed to use the pretrained model on coco stuff

I tried to use coco generated instance file to generated instances maps for them but i got the following error
/mnt/HDD/VE_Saida/lib/python3.6/site-packages/skimage/io/_io.py:48: UserWarning: as_grey has been deprecated in favor of as_gray
warn('as_grey has been deprecated in favor of as_gray')
Traceback (most recent call last):
File "/mnt/HDD/VE_Saida/Updated_SPADE/SPADE-master/datasets/coco_generate_instance_map.py", line 54, in
img[rr, cc] = count
IndexError: index 256 is out of bounds for axis 0 with size 256

Process finished with exit code 1

Can you please let me know how can i use pre-trained mode for coco stuff on my lables maps dataset, I mean how i can generated instances for them .

Thank you very much

from spade.

SaidaSaad avatar SaidaSaad commented on July 22, 2024

Hello @code-de , did you solve this issue ?

from spade.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.