Maskrcnn-benchmark: TypeError: smooth_l1_loss() got an unexpected keyword argument 'reduction'

Created on 21 Jan 2019  路  1Comment  路  Source: facebookresearch/maskrcnn-benchmark

馃悰 Bug

I got this error on run tools/train_net.py.

Traceback (most recent call last):
  File "tools/train_net.py", line 171, in <module>
    main()
  File "tools/train_net.py", line 164, in main
    model = train(cfg, args.local_rank, args.distributed)
  File "tools/train_net.py", line 73, in train
    arguments,
  File "/content/maskrcnn-benchmark/maskrcnn_benchmark/engine/trainer.py", line 66, in do_train
    loss_dict = model(images, targets)
  File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "/content/maskrcnn-benchmark/maskrcnn_benchmark/modeling/detector/generalized_rcnn.py", line 50, in forward
    proposals, proposal_losses = self.rpn(images, features, targets)
  File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "/content/maskrcnn-benchmark/maskrcnn_benchmark/modeling/rpn/rpn.py", line 100, in forward
    return self._forward_train(anchors, objectness, rpn_box_regression, targets)
  File "/content/maskrcnn-benchmark/maskrcnn_benchmark/modeling/rpn/rpn.py", line 119, in _forward_train
    anchors, objectness, rpn_box_regression, targets
  File "/content/maskrcnn-benchmark/maskrcnn_benchmark/modeling/rpn/loss.py", line 129, in __call__
    reduction='sum',
TypeError: smooth_l1_loss() got an unexpected keyword argument 'reduction'

To Reproduce

Steps to reproduce the behavior:

  1. Clone this repository (6cbb3d27b8bb3de3547e9214f1ffc971d6853736) and install the requirements
  2. python setup.py build develop
  3. python tools/train_net.py --config-file configs/e2e_faster_rcnn_R_50_C4_1x.yaml

Expected behavior

Environment

Collecting environment information...
PyTorch version: 1.0.0
Is debug build: No
CUDA used to build PyTorch: 9.0.176

OS: Ubuntu 18.04.1 LTS
GCC version: (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
CMake version: version 3.12.0

Python version: 3.6
Is CUDA available: Yes
CUDA runtime version: 9.2.148
GPU models and configuration: GPU 0: Tesla K80
Nvidia driver version: 396.44
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.7.4.1
/usr/lib/x86_64-linux-gnu/libcudnn_static_v7.a
/usr/local/lib/python2.7/dist-packages/cupy/_lib/libcudnn.so.7
/usr/local/lib/python3.6/dist-packages/cupy/_lib/libcudnn.so.7

Versions of relevant libraries:
[pip] Could not collect
[conda] Could not collect
  • PyTorch Version (e.g., 1.0): 1.0.0
  • OS (e.g., Linux): Ubuntu 18.04.1 LTS
  • How you installed PyTorch (conda, pip, source): pip
  • Build command you used (if compiling from source): python setup.py build develop
  • Python version: 3.6
  • CUDA/cuDNN version: 9.2.148
  • GPU models and configuration: Tesla K80
  • Any other relevant information:

Additional context

It seems that this error caused by the latest PR (#359 ).

bug

Most helpful comment

Thanks for the heads up, I've reverted the offending PR https://github.com/facebookresearch/maskrcnn-benchmark/pull/364

>All comments

Thanks for the heads up, I've reverted the offending PR https://github.com/facebookresearch/maskrcnn-benchmark/pull/364

Was this page helpful?
0 / 5 - 0 ratings