提交 a2575523 编写于 作者: W wuzewu

Update param name in detection task

上级 790860aa
......@@ -67,30 +67,28 @@ class FasterRCNNTask(DetectionTask):
head_feat = self.main_program.global_block().vars[
self.predict_feature[0].name]
# Rename following layers for: ValueError: Variable cls_score_w has been created before.
# the previous shape is (2048, 81); the new shape is (100352, 81).
# They are not matched.
cls_score = fluid.layers.fc(
input=head_feat,
size=self.num_classes,
act=None,
name='my_cls_score',
name='paddlehub_rcnn_cls_score',
param_attr=ParamAttr(
name='my_cls_score_w', initializer=Normal(loc=0.0, scale=0.01)),
name='paddlehub_rcnn_cls_score_weights',
initializer=Normal(loc=0.0, scale=0.01)),
bias_attr=ParamAttr(
name='my_cls_score_b',
name='paddlehub_rcnn_cls_score_bias',
learning_rate=2.,
regularizer=L2Decay(0.)))
bbox_pred = fluid.layers.fc(
input=head_feat,
size=4 * self.num_classes,
act=None,
name='my_bbox_pred',
name='paddlehub_rcnn_bbox_pred',
param_attr=ParamAttr(
name='my_bbox_pred_w', initializer=Normal(loc=0.0,
scale=0.001)),
name='paddlehub_rcnn_bbox_pred_weights',
initializer=Normal(loc=0.0, scale=0.001)),
bias_attr=ParamAttr(
name='my_bbox_pred_b',
name='paddlehub_rcnn_bbox_pred_bias',
learning_rate=2.,
regularizer=L2Decay(0.)))
......
......@@ -90,10 +90,10 @@ class YOLOTask(DetectionTask):
act=None,
# Rename for: conflict with module pretrain weights
param_attr=ParamAttr(
name="ft_yolo_output.{}.conv.weights".format(i)),
name="paddlehub_yolo_output.{}.conv.weights".format(i)),
bias_attr=ParamAttr(
regularizer=L2Decay(0.),
name="ft_yolo_output.{}.conv.bias".format(i)))
name="paddlehub_yolo_output.{}.conv.bias".format(i)))
outputs.append(block_out)
if self.is_train_phase:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册