Skip to content

Commit 649f5d7

Browse files
author
Bai Yifan
authored
fix mine_hard_example bug (#12664)
1 parent f54efd0 commit 649f5d7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

paddle/fluid/operators/detection/mine_hard_examples_op.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ class MineHardExamplesOp : public framework::OperatorWithKernel {
227227
PADDLE_ENFORCE_GT(
228228
neg_pos_ratio, 0.0f,
229229
"neg_pos_ratio must greater than zero in max_negative mode");
230+
PADDLE_ENFORCE_LT(
231+
neg_dist_threshold, 1.0f,
232+
"neg_dist_threshold must less than one in max_negative mode");
230233
PADDLE_ENFORCE_GT(
231234
neg_dist_threshold, 0.0f,
232235
"neg_dist_threshold must greater than zero in max_negative mode");

python/paddle/fluid/layers/detection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ def __reshape_to_2d(var):
722722
},
723723
attrs={
724724
'neg_pos_ratio': neg_pos_ratio,
725-
'neg_dist_threshold': neg_pos_ratio,
725+
'neg_dist_threshold': neg_overlap,
726726
'mining_type': mining_type,
727727
'sample_size': sample_size,
728728
})

0 commit comments

Comments
 (0)