roytseng-tw / Detectron.pytorch

A pytorch implementation of Detectron. Both training from scratch and inferring directly from pretrained Detectron weights are available.
MIT License
2.82k stars 565 forks source link

Using ‘Adam’ to train, encountering error. #200

Open lilichu opened 5 years ago

lilichu commented 5 years ago

hi! I train keypoint using mask rcnn. If I use 'Adam' to train, I encounter the issue such as:

/home1/chuli/mask-rcnn.pytorch/lib/utils/boxes.py:226: RuntimeWarning: invalid value encountered in log
  targets_dh = wh * np.log(gt_heights / ex_heights)
/home1/chuli/mask-rcnn.pytorch/lib/utils/boxes.py:225: RuntimeWarning: invalid value encountered in log
  targets_dw = ww * np.log(gt_widths / ex_widths)
/home1/chuli/mask-rcnn.pytorch/lib/utils/boxes.py:66: RuntimeWarning: Negative areas founds: 187
  warnings.warn("Negative areas founds: %d" % neg_area_idx.size, RuntimeWarning)

but if I use 'SGD', it is OK. I only replace 'SGD' with 'Adam', nothing else is changed.