question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error while running image_demo.py

See original GitHub issue

I tried to run the demo in colab after following the install.md guide i successfully build iterdet but got a runtime error when tried to image_demo.py

Reproduction

python demo/image_demo.py demo/demo.jpg configs/iterdet/crowd_human_visible_faster_rcnn_r50_fpn_2x.py \
    crowd_human_visible_faster_rcnn_r50_fpn_2x.pth --device gpu

Environment python mmdet/utils/collect_env.py also gives the same error

Traceback (most recent call last):
  File "mmdet/utils/collect_env.py", line 62, in <module>
    for name, val in collect_env().items():
  File "mmdet/utils/collect_env.py", line 55, in collect_env
    from mmdet.ops import get_compiler_version, get_compiling_cuda_version
  File "/content/iterdet/mmdet/ops/__init__.py", line 2, in <module>
    from .conv_ws import ConvWS2d, conv_ws_2d
  File "/content/iterdet/mmdet/ops/conv_ws.py", line 23, in <module>
    class ConvWS2d(nn.Conv2d):
  File "/usr/local/lib/python3.6/dist-packages/mmcv/utils/registry.py", line 122, in _register
    module_class=cls, module_name=name, force=force)
  File "/usr/local/lib/python3.6/dist-packages/mmcv/utils/registry.py", line 58, in _register_module
    raise KeyError(f'{module_name} is already registered '
KeyError: 'ConvWS is already registered in conv layer'
torch==1.5.1+cu101
torchvision==0.6.1+cu101
mmdet==2.0.0+1531b8d
mmcv==1.0.4

nvcc --version

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243

gcc --version

gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Error traceback

Traceback (most recent call last):
  File "demo/image_demo.py", line 3, in <module>
    from mmdet.apis import inference_detector, init_detector, show_result_pyplot
  File "/content/iterdet/mmdet/apis/__init__.py", line 1, in <module>
    from .inference import (async_inference_detector, inference_detector,
  File "/content/iterdet/mmdet/apis/inference.py", line 9, in <module>
    from mmdet.core import get_classes
  File "/content/iterdet/mmdet/core/__init__.py", line 5, in <module>
    from .mask import *  # noqa: F401, F403
  File "/content/iterdet/mmdet/core/mask/__init__.py", line 2, in <module>
    from .structures import BitmapMasks, PolygonMasks
  File "/content/iterdet/mmdet/core/mask/structures.py", line 8, in <module>
    from mmdet.ops.roi_align import roi_align
  File "/content/iterdet/mmdet/ops/__init__.py", line 2, in <module>
    from .conv_ws import ConvWS2d, conv_ws_2d
  File "/content/iterdet/mmdet/ops/conv_ws.py", line 23, in <module>
    class ConvWS2d(nn.Conv2d):
  File "/usr/local/lib/python3.6/dist-packages/mmcv/utils/registry.py", line 122, in _register
    module_class=cls, module_name=name, force=force)
  File "/usr/local/lib/python3.6/dist-packages/mmcv/utils/registry.py", line 58, in _register_module
    raise KeyError(f'{module_name} is already registered '
KeyError: 'ConvWS is already registered in conv layer'

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
filaProcommented, Jul 27, 2020

Fixed in b293300.

1reaction
Udit1999commented, Jul 27, 2020

Hi @filaPro Thanks for your help. The issue is fixed by downgrading mmcv to 0.5.1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Why I'm getting this error while building docker image?
I got the following error while building a docker image by ... ERROR: Failed building wheel for cffi Running setup.py clean for cffi...
Read more >
error when running training/main.py · Issue #35 - GitHub
I am getting a ModuleNotFoundError for training when running src/training/main.py. It points to line 19 in main.py, the import function.
Read more >
Image Demo — Matplotlib 3.6.2 documentation
The most common way to plot images in Matplotlib is with imshow . The following examples demonstrate much of the functionality of imshow...
Read more >
Command python setup py egg info failed with error code 1 in ...
Hi Guys, I am trying to install jupyter in my Windows system, but It shows me the below error ... \AppData\Local\Temp\ How can...
Read more >
Introduction to Programming Using Python - Accord University
t VideoNotes are step-by-step video tutorials specifically designed to enhance the program- ming concepts presented in this textbook. t Web Chapters are ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found