fix mine_hard_example bug (#12664)

python3
Bai Yifan 7 years ago committed by GitHub
parent f54efd027e
commit 649f5d74f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -227,6 +227,9 @@ class MineHardExamplesOp : public framework::OperatorWithKernel {
PADDLE_ENFORCE_GT( PADDLE_ENFORCE_GT(
neg_pos_ratio, 0.0f, neg_pos_ratio, 0.0f,
"neg_pos_ratio must greater than zero in max_negative mode"); "neg_pos_ratio must greater than zero in max_negative mode");
PADDLE_ENFORCE_LT(
neg_dist_threshold, 1.0f,
"neg_dist_threshold must less than one in max_negative mode");
PADDLE_ENFORCE_GT( PADDLE_ENFORCE_GT(
neg_dist_threshold, 0.0f, neg_dist_threshold, 0.0f,
"neg_dist_threshold must greater than zero in max_negative mode"); "neg_dist_threshold must greater than zero in max_negative mode");

@ -722,7 +722,7 @@ def ssd_loss(location,
}, },
attrs={ attrs={
'neg_pos_ratio': neg_pos_ratio, 'neg_pos_ratio': neg_pos_ratio,
'neg_dist_threshold': neg_pos_ratio, 'neg_dist_threshold': neg_overlap,
'mining_type': mining_type, 'mining_type': mining_type,
'sample_size': sample_size, 'sample_size': sample_size,
}) })

Loading…
Cancel
Save