-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Conversation
Test? :) |
Yes, I've tested compared to interpolate of |
Yeah, it would be great if you could add testcases |
add BilinearResize2D test fix BilinearResize2D align_corners test fix code layout fix resize gpu and cpu consistency fix bilinear reisze test bug close transforms.resize test
@wkcn @zhanghang1989 @marcoabreu for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution!
If there is some code reference, please add the note which part is Adapted from xxx
and its link, like https://github.com/apache/incubator-mxnet/blob/master/src/operator/pad.cc#L34.
Thx!
src/operator/image/resize.cu
Outdated
@@ -65,7 +65,7 @@ void ResizeImplCUDA(mshadow::Stream<gpu> *s, | |||
cudaStream_t stream = mshadow::Stream<gpu>::GetStream(s); | |||
caffe_gpu_interp2_kernel<gpu, DType, AccReal> | |||
<<<blocks, threads , 0, stream>>>( | |||
num_kernels, rheight, rwidth, input, output, layout); | |||
num_kernels, rheight, rwidth, /*align_corners=*/false, input, output); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove commented out code
@@ -146,12 +146,16 @@ def py_bilinear_resize_nhwc(x, outputHeight, outputWidth): | |||
w1lambda*x[b][h1+h1p][w1+w1p][c]) | |||
return y | |||
|
|||
# TODO: close tests below, because `transforms.Resize` use BilinearResize2D(with align_corners=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove them then and put the reason into the PR description
@wkcn It's all resolved, can we merge this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the great contribution!
LGTM : )
fix resize.cu
Merged. Thanks for your great contribution! |
Description
align_corners
param in resize op is first introduced byten*low
, thenpy*ch
also bring it to itsinterpolate
op. Ourmx.nd.contrib.BilinearResize2D
op only supportalign_corners=True
before. Now, We bringalign_corners=False
(same as OpenCV resize in LINEAR mode) support as sometimes it will get more efficient.mx.nd.contrib.BilinearResize2D
.mx.nd.contrib.BilinearResize2D
in fp16 as it is too slow before. As I've tested, If we explictly set dtype tofloat16
, we can speed up our training when compared tofloat32
. So we can speed up the training of gluoncv segmentation models later.nd.image.resize
op, keep it consistent in CPU and GPUtest_gluon_transforms.py
as it's not right.Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments