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

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

Closed
wangxiao5791509 opened this issue Mar 30, 2017 · 6 comments
Closed

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

wangxiao5791509 opened this issue Mar 30, 2017 · 6 comments

Comments

@wangxiao5791509
Copy link

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
load_weights(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
Copy link
Collaborator

junting commented Mar 30, 2017

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
Copy link
Author

@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
load_weights(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
Copy link

remega commented Jan 19, 2018

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

@remega
Copy link

remega commented Jan 19, 2018

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

@DuanHuiyu
Copy link

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

Can anyone help with this?

@Saloqin
Copy link

Saloqin commented Mar 6, 2018

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

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

5 participants