Commit d263818b authored by Yuxin Wu's avatar Yuxin Wu

[MaskRCNN] use L1

parent 0831fe9d
......@@ -178,7 +178,7 @@ _C.RPN.TEST_PER_LEVEL_NMS_TOPK = 1000
# fastrcnn training ---------------------
_C.FRCNN.BATCH_PER_IM = 512
_C.FRCNN.BBOX_REG_WEIGHTS = [20., 20., 10., 10.] # Detectron: 10, 10, 5, 5
_C.FRCNN.BBOX_REG_WEIGHTS = [10., 10., 5., 5.] # Slightly better setting: 20, 20, 10, 10
_C.FRCNN.FG_THRESH = 0.5
_C.FRCNN.FG_RATIO = 0.25 # fg ratio in a ROI batch
......
# -*- coding: utf-8 -*-
# File: model.py
# File: model_frcnn.py
import tensorflow as tf
......@@ -164,8 +164,7 @@ def fastrcnn_losses(labels, label_logits, fg_boxes, fg_box_logits):
fg_accuracy = tf.where(
empty_fg, 0., tf.reduce_mean(tf.gather(correct, fg_inds)), name='fg_accuracy')
box_loss = tf.losses.huber_loss(
fg_boxes, fg_box_logits, reduction=tf.losses.Reduction.SUM)
box_loss = tf.reduce_sum(tf.abs(fg_boxes - fg_box_logits))
box_loss = tf.truediv(
box_loss, tf.cast(tf.shape(labels)[0], tf.float32), name='box_loss')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment