CornerNet-Lite icon indicating copy to clipboard operation
CornerNet-Lite copied to clipboard

UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.

Open fengzifrank opened this issue 5 years ago • 7 comments

This error occurs when I run demo.py. Is this a problem with pytorch? However, the environment is executed according to the configuration file. thank you

loading from /test/CornerNet-Lite/core/../cache/nnet/CornerNet_Saccade/CornerNet_Saccade_500000.pkl /opt/conda/envs/CornerNet_Lite/lib/python3.7/site-packages/torch/nn/functional.py:2423: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details. "See the documentation of nn.Upsample for details.".format(mode))

fengzifrank avatar Apr 21 '19 03:04 fengzifrank

I meet same problems,can you solve it ?@fengzifrank

wangshaobobetter avatar Apr 21 '19 07:04 wangshaobobetter

This is a warning from PyTorch as there is a change in the behavior of upsampling since version 0.4.0. You can safely ignore this warning.

heilaw avatar Apr 21 '19 21:04 heilaw

The problem of changing his model is solved. CornerNet_Saccade() seems to have some problems.

#!/usr/bin/env python import cv2 from core.detectors import CornerNet_Squeeze from core.vis_utils import draw_bboxes

detector = CornerNet_Squeeze() image = cv2.imread("demo.jpg")

bboxes = detector(image) image = draw_bboxes(image, bboxes) cv2.imwrite("demo_1.jpg", image)

fengzifrank avatar Apr 22 '19 02:04 fengzifrank

This error occurs when I run demo.py loading from ../cache/nnet/CornerNet_Squeeze/CornerNet_Squeeze_500000.pkl Segmentation fault

cwjhx avatar Apr 24 '19 04:04 cwjhx

In pytorch official tutorial, there are some clear explanation about this problem. https://pytorch.org/docs/stable/nn.html?highlight=upsample#torch.nn.Upsample that is: With align_corners = True, the linearly interpolating modes (linear, bilinear, bicubic, and trilinear) don’t proportionally align the output and input pixels, and thus the output values can depend on the input size. This was the default behavior for these modes up to version 0.3.1. Since then, the default behavior is align_corners = False. See below for concrete examples on how this affects the outputs.

hiterjoshua avatar Aug 12 '19 07:08 hiterjoshua

seems it is related with pytorch jit: https://github.com/DeepVAC/MLab/issues/47

gemfield avatar Jul 06 '21 09:07 gemfield

This error occurs when I run demo.py. Is this a problem with pytorch? However, the environment is executed according to the configuration file. thank you

loading from /test/CornerNet-Lite/core/../cache/nnet/CornerNet_Saccade/CornerNet_Saccade_500000.pkl /opt/conda/envs/CornerNet_Lite/lib/python3.7/site-packages/torch/nn/functional.py:2423: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details. "See the documentation of nn.Upsample for details.".format(mode))

I solved problem. the problem is opencv version base on c++, so that is Segmentation fault just typed the commandline to change version of opencv: $ pip3 install opencv-python==4.0.1.24

duymanhdoan avatar Apr 01 '22 03:04 duymanhdoan