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

Depreciation warning when running inference w/Pytorch 1.10.1 #3983

Open
rtarquini opened this issue Feb 18, 2022 · 2 comments
Open

Depreciation warning when running inference w/Pytorch 1.10.1 #3983

rtarquini opened this issue Feb 18, 2022 · 2 comments

Comments

@rtarquini
Copy link

rtarquini commented Feb 18, 2022

Depreciation warning when running inference with Detectron2 v0.6 + pytorch 1.10.1, cuda 10.2

Details

detectron2/detectron2/structures/image_list.py:88: UserWarning: floordiv is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').
max_size = (max_size + (stride - 1)) // stride * stride

Environment:


sys.platform linux
Python 3.9.6 (default, Feb 18 2022, 13:15:09) [GCC 7.5.0]
numpy 1.22.1
detectron2 0.6 @/opt/thirdparty/detectron2/detectron2
Compiler GCC 7.5
CUDA compiler CUDA 10.2
detectron2 arch flags 5.0, 6.0, 6.1, 7.0, 7.5
DETECTRON2_ENV_MODULE
PyTorch 1.10.1+cu102 @/usr/local/lib/python3.9/site-packages/torch
PyTorch debug build False
GPU available Yes
GPU 0,1,2,3 NVIDIA GeForce GTX 1080 (arch=6.1)
Driver version 470.103.01
CUDA_HOME /usr/local/cuda
TORCH_CUDA_ARCH_LIST 5.0;6.0;6.1;7.0;7.5
Pillow 9.0.1
torchvision 0.11.2+cu102 @/usr/local/lib/python3.9/site-packages/torchvision
torchvision arch flags 3.5, 5.0, 6.0, 7.0, 7.5
fvcore 0.1.5.post20220212
iopath 0.1.9
cv2 4.4.0


PyTorch built with:

  • GCC 7.3
  • C++ Version: 201402
  • Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191122 for Intel(R) 64 architecture applications
  • Intel(R) MKL-DNN v2.2.3 (Git Hash 7336ca9f055cf1bfa13efb658fe15dc9b41f0740)
  • OpenMP 201511 (a.k.a. OpenMP 4.5)
  • LAPACK is enabled (usually provided by MKL)
  • NNPACK is enabled
  • CPU capability usage: AVX2
  • CUDA Runtime 10.2
  • NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_70,code=sm_70
  • CuDNN 7.6.5
  • Magma 2.5.2
  • Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=10.2, CUDNN_VERSION=7.6.5, CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/c++, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.10.1, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON,

Testing NCCL connectivity ... this should not hang.
NCCL succeeded.

@rtarquini rtarquini changed the title Please read & provide the following Depreciation warning when running inference Feb 18, 2022
@rtarquini rtarquini changed the title Depreciation warning when running inference Depreciation warning when running inference w/Pytorch 1.10.1 Feb 18, 2022
@bertsky
Copy link

bertsky commented May 3, 2022

Should be gone after bb52414 – which is not in latest release (v0.6) yet.

@c-hoffmann
Copy link

c-hoffmann commented Oct 21, 2022

There seem to be a number of other floordiv usages in the code, e.g. at structures/keypoints.py, line 224 (this is the one that keeps coming up for me currently when using Detectron2 as dependency of VideoPose3D).
I assume
y_int = (pos - x_int) // w
would need to be replaced by
y_int = (pos - x_int).div(w, rounding_mode="floor")

EDIT: I tried calculating a *.npz both ways (utilizing VideoPose3D's infer_video_d2.py) and ended up with different files according to diff and Meld. Didn't take a closer look into the data though.

acerioni added a commit to swiss-territorial-data-lab/object-detector that referenced this issue May 25, 2023
cleherny pushed a commit to swiss-territorial-data-lab/object-detector that referenced this issue Sep 15, 2023
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

3 participants