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

TypeError: div() got an unexpected keyword argument 'rounding_mode' #3889

Closed
fardinadii opened this issue Jan 16, 2022 · 1 comment
Closed

Comments

@fardinadii
Copy link

Instructions To Reproduce the 🐛 Bug:

/workspace/detectron2/detectron2/detectron2/structures/masks.py:368: UserWarning: This overload of nonzero is deprecated:
nonzero()
Consider using one of the following signatures instead:
nonzero(, bool as_tuple) (Triggered internally at ../torch/csrc/utils/python_arg_parser.cpp:962.)
item = item.nonzero().squeeze(1).cpu().numpy().tolist()
/workspace/detectron2/detectron2/detectron2/structures/masks.py:368: UserWarning: This overload of nonzero is deprecated:
nonzero()
Consider using one of the following signatures instead:
nonzero(
, bool as_tuple) (Triggered internally at ../torch/csrc/utils/python_arg_parser.cpp:962.)
item = item.nonzero().squeeze(1).cpu().numpy().tolist()
Exception during training:
Traceback (most recent call last):
File "/workspace/detectron2/func_detectron2_v1.py", line 335, in train
self.run_step()
File "/workspace/detectron2/detectron2/detectron2/engine/defaults.py", line 494, in run_step
self._trainer.run_step()
File "/workspace/detectron2/detectron2/detectron2/engine/train_loop.py", line 273, in run_step
loss_dict = self.model(data)
File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/workspace/detectron2/detectron2/detectron2/modeling/meta_arch/rcnn.py", line 148, in forward
images = self.preprocess_image(batched_inputs)
File "/workspace/detectron2/detectron2/detectron2/modeling/meta_arch/rcnn.py", line 226, in preprocess_image
images = ImageList.from_tensors(images, self.backbone.size_divisibility)
File "/workspace/detectron2/detectron2/detectron2/structures/image_list.py", line 88, in from_tensors
max_size = (max_size + (stride - 1)).div(stride, rounding_mode="floor") * stride
TypeError: div() got an unexpected keyword argument 'rounding_mode'

Expected behavior:

TypeError: div() got an unexpected keyword argument 'rounding_mode'

Environment:

sys.platform linux
Python 3.6.10 |Anaconda, Inc.|
numpy 1.19.2
detectron2 0.6 @/workspace/detectron2/detectron2/detectron2
Compiler GCC 7.5
CUDA compiler CUDA 11.1
detectron2 arch flags 5.2, 6.0, 6.1, 7.0, 7.5, 8.0, 8.6
DETECTRON2_ENV_MODULE
PyTorch 1.8.0a0+17f8c32 @/opt/conda/lib/python3.6/site-packages/torch
PyTorch debug build True
GPU available Yes
GPU 0 GeForce RTX 3090 (arch=8.6)
Driver version 455.23.04
CUDA_HOME /usr/local/cuda
TORCH_CUDA_ARCH_LIST 5.2 6.0 6.1 7.0 7.5 8.0 8.6+PTX
Pillow 8.4.0
torchvision 0.8.0a0 @/opt/conda/lib/python3.6/site-packages/torchvision
torchvision arch flags 5.2, 6.0, 6.1, 7.0, 7.5, 8.0, 8.6
fvcore 0.1.5.post20211023
iopath 0.1.9
cv2 3.4.1

@fardinadii fardinadii changed the title Please read & provide the following TypeError: div() got an unexpected keyword argument 'rounding_mode' Jan 16, 2022
@ppwwyyxx
Copy link
Contributor

The minimum pytorch version is 1.8 official. Your pytorch version is older than what we supported.

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

No branches or pull requests

2 participants