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

ERROR: Cannot copy param 0 weights from layer 'fc6'; shape mismatch #1525

Closed
xhuvom opened this issue Mar 21, 2017 · 3 comments
Closed

ERROR: Cannot copy param 0 weights from layer 'fc6'; shape mismatch #1525

xhuvom opened this issue Mar 21, 2017 · 3 comments

Comments

@xhuvom
Copy link

xhuvom commented Mar 21, 2017

I am trying to train a segmentation model from semantic-segmentation example on DIGITS. Training a Custom Network with the prototxt and FCN_Alexnet returns the following error:

ERROR: Cannot copy param 0 weights from layer 'fc6'; shape mismatch. Source param shape is 1 1 4096 9216 (37748736); target param shape is 4096 256 6 6 (37748736). To learn this layer's parameters from scratch rather than copying from a saved net, rename the layer.

norm1 needs backward computation.
pool1 needs backward computation.
relu1 needs backward computation.
conv1 needs backward computation.
shift does not need backward computation.
label_label_0_split does not need backward computation.
label does not need backward computation.
data_data_0_split does not need backward computation.
data does not need backward computation.
This network produces output accuracy
This network produces output loss
Network initialization done.
Solver scaffolding done.
Finetuning from /home/xhuv/DIGITS-5.0.0/fcn_alexnet.caffemodel
Attempting to upgrade input file specified using deprecated transformation parameters: /home/xhuv/DIGITS-5.0.0/fcn_alexnet.caffemodel
Successfully upgraded file specified using deprecated data transformation parameters.
Note that future Caffe releases will only support transform_param messages for transformation fields.
Attempting to upgrade input file specified using deprecated V1LayerParameter: /home/xhuv/DIGITS-5.0.0/fcn_alexnet.caffemodel
Successfully upgraded file specified using deprecated V1LayerParameter
Cannot copy param 0 weights from layer 'fc6'; shape mismatch.  Source param shape is 1 1 4096 9216 (37748736); target param shape is 4096 256 6 6 (37748736). To learn this layer's parameters from scratch rather than copying from a saved net, rename the layer.

Should I change the prototxt with modifications on the layers?

@lukeyeager
Copy link
Member

You'll want to change the name of the layer. I'm not sure we've documented this anywhere (it's really a Caffe thing, not a DIGITS thing), but I answered a similar SO post here: http://stackoverflow.com/a/39837047/2404152.

@xhuvom
Copy link
Author

xhuvom commented Mar 21, 2017

Thanks. Renaming the layer works good !

@xhuvom xhuvom closed this as completed Mar 21, 2017
@DHW-Master
Copy link

您好,你是怎么重命名图层的谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants