diff --git a/src/operator/contrib/roi_align.cc b/src/operator/contrib/roi_align.cc index dc4aa8b7de9e..e584ea30325d 100644 --- a/src/operator/contrib/roi_align.cc +++ b/src/operator/contrib/roi_align.cc @@ -157,10 +157,9 @@ void ROIAlignForward( int n_rois = nthreads / channels / pooled_width / pooled_height; // (n, c, ph, pw) is an element in the pooled output // can be parallelized using omp - int n; -#pragma omp parallel for private(n) \ +#pragma omp parallel for \ num_threads(engine::OpenMP::Get()->GetRecommendedOMPThreadCount()) - for (n = 0; n < n_rois; n++) { + for (int n = 0; n < n_rois; n++) { int index_n = n * channels * pooled_width * pooled_height; // roi could have 4 or 5 columns @@ -564,7 +563,8 @@ He, Kaiming, et al. "Mask R-CNN." ICCV, 2017 out_shape->clear(); if (param.position_sensitive) { CHECK_EQ(dshape[1] % (param.pooled_size[0]*param.pooled_size[1]), 0) << - "Input channels should be divided by pooled_size[0]*pooled_size[1]"; + "Input channels should be divided by pooled_size[0]*pooled_size[1]" + "when position_sensitive is true."; out_shape->push_back( Shape4(bshape[0], dshape[1]/param.pooled_size[0]/param.pooled_size[1], param.pooled_size[0], param.pooled_size[1]));