未验证 提交 1317022a 编写于 作者: S ShenLiang 提交者: GitHub

fix the dtype of loss (#1317)

上级 25877ca3
......@@ -404,5 +404,5 @@ class RetinaHead(object):
inside_weight=bbox_weight,
outside_weight=bbox_weight)
loss_bbox = fluid.layers.reduce_sum(loss_bbox, name='loss_bbox')
loss_bbox = loss_bbox / fg_num
loss_bbox = loss_bbox / fluid.layers.cast(fg_num, loss_bbox.dtype)
return {'loss_cls': loss_cls, 'loss_bbox': loss_bbox}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册