mirror of
https://github.com/open-mmlab/mmsegmentation.git
synced 2025-06-03 22:03:48 +08:00
[Fix] bug of resize warning when align_corners is True (#1592)
Signed-off-by: FreyWang <wangwxyz@qq.com>
This commit is contained in:
parent
4534fb6868
commit
4f394b0674
@ -15,7 +15,7 @@ def resize(input,
|
|||||||
if size is not None and align_corners:
|
if size is not None and align_corners:
|
||||||
input_h, input_w = tuple(int(x) for x in input.shape[2:])
|
input_h, input_w = tuple(int(x) for x in input.shape[2:])
|
||||||
output_h, output_w = tuple(int(x) for x in size)
|
output_h, output_w = tuple(int(x) for x in size)
|
||||||
if output_h > input_h or output_w > output_h:
|
if output_h > input_h or output_w > input_w:
|
||||||
if ((output_h > 1 and output_w > 1 and input_h > 1
|
if ((output_h > 1 and output_w > 1 and input_h > 1
|
||||||
and input_w > 1) and (output_h - 1) % (input_h - 1)
|
and input_w > 1) and (output_h - 1) % (input_h - 1)
|
||||||
and (output_w - 1) % (input_w - 1)):
|
and (output_w - 1) % (input_w - 1)):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user