cannot copy param 0 weights from layer

本文解决了一个在使用Caffe框架训练深度学习模型时遇到的参数形状不匹配问题,通过删除solverstate文件并修改模型中层的名字,成功解决了预训练网络参数与当前模型架构不一致的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

I have this problem when i train my data by caffe .

F1107 12:42:42.507861  2369 net.cpp:774] Cannot copy param 0 weights from layer 'conv4_3_norm_mbox_conf'; shape mismatch.  Source param shape is 40 512 3 5 (307200); target param shape is 180 512 3 5 (1382400). To learn this layer's parameters from scratch rather than copying from a saved net, rename the layer.

这是由于预训练网络的参数与当前模型架构对不上,只要把出现错误的层名字改了就ok了!!之前识别的是两类(background和text),然后源码每个点是有20个priorbox,所以num_output是40,现在我要识别11类,输出应该是220才对。

I have solved this problem by delete the file like "VGG_text_text_polygon_precise_fix_order_384x384_iter_120000.solverstate"

Delete all solverstate file and problem have solved .

Later, I realize that the true reason is that I have altered another caffemodel to train my data , so I can solve this problem!

 

The latest solvement is to rename the layer's name which you add, or you can change the layers'name in "model_libs.py".  It works!

But the train val is very low so I think this is a bad solvement ?Oh my god ~I don't know what I can do !

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值