imatge-upc / salgan

SalGAN: Visual Saliency Prediction with Generative Adversarial Networks
https://imatge-upc.github.io/salgan
MIT License
368 stars 106 forks source link

ValueError: mismatch: got 20 values to set 18 parameters #13

Closed wangxiao5791509 closed 7 years ago

wangxiao5791509 commented 7 years ago

Hi, thanks for the code and trained model. But, I found when load the trained model of discriminator you provided, it shown me the following error. Could you check that model again ? Thanks.

Traceback (most recent call last): File "wangxiao-02-train.py", line 184, in train()
File "wangxiao-02-train.py", line 169, in train loadweights(net=model.discriminator['fc5'], path="test/discrim", epochtoload=90) File "/media/wangxiao/724eaeef-e688-4b09-9cc9-dfaca44079b2/saliency-salgan-2017-master-tracking/scripts/utils.py", line 24, in load_weights lasagne.layers.set_all_param_values(net, param_values) File "/home/wangxiao/Lasagne/src/lasagne/lasagne/layers/helper.py", line 512, in set_all_param_values (len(values), len(params))) ValueError: mismatch: got 20 values to set 18 parameters

junting commented 7 years ago

Hi @wangxiao5791509 ,

Sorry, the key for the discriminator was wrong, please try this: load_weights(net=model.discriminator['prob'], path="test/discrim_", epochtoload=90)

wangxiao5791509 commented 7 years ago

@junting Thanks your kind replay. But still get wrong, the same problem: mismatched. Does it caused by input image size ? I keep it the same as yours, but still can not run smoothly ...

Traceback (most recent call last): File "wangxiao-02-train.py", line 187, in train()
File "wangxiao-02-train.py", line 169, in train loadweights(net=model.discriminator['prob'], path="./discrim", epochtoload=90) File "/media/wangxiao/724eaeef-e688-4b09-9cc9-dfaca44079b2/saliency-salgan-2017-master-tracking/scripts/utils.py", line 24, in load_weights lasagne.layers.set_all_param_values(net, param_values) File "/home/wangxiao/Lasagne/src/lasagne/lasagne/layers/helper.py", line 518, in set_all_param_values (p.get_value().shape, v.shape)) ValueError: mismatch: parameter has shape (12288, 100) but value to set has shape (12288, 60)

remega commented 6 years ago

Hi, guys. I met the same problem. Have you solved it? Looking forward to your reply!

remega commented 6 years ago

I mean, ValueError: mismatch: parameter has shape (12288, 100) but value to set has shape (12288, 60)

DuanHuiyu commented 6 years ago

The same problem "ValueError: mismatch: parameter has shape (12288, 100) but value to set has shape (12288, 60)".

Can anyone help with this?

Saloqin commented 6 years ago

+1 ValueError: mismatch: parameter has shape (12288, 100) but value to set has shape (12288, 60) anyone knows whats going on?