Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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. #7

Open
fengzifrank opened this issue Apr 21, 2019 · 7 comments

Comments

@fengzifrank
Copy link

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))

@wangshaobobetter
Copy link

wangshaobobetter commented Apr 21, 2019

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

@heilaw
Copy link
Contributor

heilaw commented Apr 21, 2019

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.

@fengzifrank
Copy link
Author

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)

@cwjhx
Copy link

cwjhx commented Apr 24, 2019

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

@hiterjoshua
Copy link

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.

@gemfield
Copy link

gemfield commented Jul 6, 2021

seems it is related with pytorch jit: DeepVAC/MLab#47

@duymanhdoan
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants