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.

mmcv.Registry unexpected resulets

See original GitHub issue

1.Describe the Issue I tried your tutorial in https://mmcv.readthedocs.io/zh_CN/latest/understand_mmcv/registry.html Error occurs after “CONVERTERS = Registry(‘converter’)” ``

Python 3.8.5 (default, Sep  4 2020, 07:30:14) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from mmcv.utils import Registry
>>> CONVERTERS = Registry('converter')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/lzl/anaconda3/lib/python3.8/site-packages/mmcv/utils/registry.py", line 92, in __init__
    self._scope = self.infer_scope() if scope is None else scope
  File "/home/lzl/anaconda3/lib/python3.8/site-packages/mmcv/utils/registry.py", line 144, in infer_scope
    filename = inspect.getmodule(inspect.stack()[2][0]).__name__
AttributeError: 'NoneType' object has no attribute '__name__'
>>>

2. My environment is Ubuntu20.04 with cuda10.2

about-time==3.1.1 absl-py==0.14.0 addict==2.4.0 aiohttp==3.7.4.post0 alabaster==0.7.12 alive-progress==2.1.0 anaconda-client==1.7.2 anaconda-navigator==1.10.0 anaconda-project==0.8.3 antlr4-python3-runtime==4.8 argh==0.26.2 argon2-cffi @ file:///tmp/build/80754af9/argon2-cffi_1596828493937/work asn1crypto @ file:///tmp/build/80754af9/asn1crypto_1596577642040/work astroid==2.8.0 astropy==4.0.2 astunparse==1.6.3 async-generator==1.10 async-timeout==3.0.1 atomicwrites==1.4.0 attrs @ file:///tmp/build/80754af9/attrs_1604765588209/work autopep8 @ file:///tmp/build/80754af9/autopep8_1596578164842/work Babel @ file:///tmp/build/80754af9/babel_1605108370292/work backcall==0.2.0 backports.functools-lru-cache==1.6.1 backports.shutil-get-terminal-size==1.0.0 backports.tempfile==1.0 backports.weakref==1.0.post1 beautifulsoup4 @ file:///tmp/build/80754af9/beautifulsoup4_1601924105527/work bitarray @ file:///tmp/build/80754af9/bitarray_1605065113847/work bkcharts==0.2 bleach @ file:///tmp/build/80754af9/bleach_1600439572647/work bokeh @ file:///tmp/build/80754af9/bokeh_1603297833684/work boto==2.49.0 Bottleneck==1.3.2 brotlipy==0.7.0 cachetools==4.2.2 certifi==2020.6.20 cffi @ file:///tmp/build/80754af9/cffi_1600699146221/work chardet==3.0.4 chumpy==0.70 click==7.1.2 cloudpickle @ file:///tmp/build/80754af9/cloudpickle_1598884132938/work clyent==1.2.2 codecov==2.1.12 colorama @ file:///tmp/build/80754af9/colorama_1603211150991/work conda==4.9.2 conda-build==3.20.5 conda-package-handling @ file:///tmp/build/80754af9/conda-package-handling_1603018141399/work conda-verify==3.4.2 configparser==5.0.2 contextlib2==0.6.0.post1 coverage==5.5 cryptography @ file:///tmp/build/80754af9/cryptography_1601046815590/work cycler==0.10.0 Cython @ file:///tmp/build/80754af9/cython_1594831566883/work cytoolz==0.11.0 dask @ file:///tmp/build/80754af9/dask-core_1602083700509/work dearpygui==1.1.1 decorator==4.4.2 defusedxml==0.6.0 diff-match-patch @ file:///tmp/build/80754af9/diff-match-patch_1594828741838/work distributed @ file:///tmp/build/80754af9/distributed_1605066520644/work docker-pycreds==0.4.0 docutils==0.16 dominate==2.6.0 entrypoints==0.3 et-xmlfile==1.0.1 fastcache==1.1.0 filelock==3.0.12 flake8 @ file:///tmp/build/80754af9/flake8_1601911421857/work Flask==1.1.2 Flask-Cors==3.0.10 flatbuffers==2.0 fsspec==2021.8.1 future==0.18.2 fvcore==0.1.5.post20211023 gevent @ file:///tmp/build/80754af9/gevent_1601397537062/work gitdb==4.0.7 GitPython==3.1.24 glob2==0.7 gmpy2==2.0.8 google-auth==1.35.0 google-auth-oauthlib==0.4.6 grapheme==0.6.0 greenlet @ file:///tmp/build/80754af9/greenlet_1600874013538/work grpcio==1.40.0 h5py==2.10.0 HeapDict==1.0.1 html5lib @ file:///tmp/build/80754af9/html5lib_1593446221756/work hydra-core==1.1.1 idna @ file:///tmp/build/80754af9/idna_1593446292537/work imageio @ file:///tmp/build/80754af9/imageio_1594161405741/work imagesize==1.2.0 importlib==1.0.4 importlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1602276842396/work importlib-resources==5.2.2 iniconfig @ file:///tmp/build/80754af9/iniconfig_1602780191262/work interrogate==1.5.0 intervaltree @ file:///tmp/build/80754af9/intervaltree_1598376443606/work iopath==0.1.9 ipykernel @ file:///tmp/build/80754af9/ipykernel_1596207638929/work/dist/ipykernel-5.3.4-py3-none-any.whl ipython @ file:///tmp/build/80754af9/ipython_1604101197014/work ipython-genutils==0.2.0 ipywidgets @ file:///tmp/build/80754af9/ipywidgets_1601490159889/work isort==4.3.21 itsdangerous==1.1.0 japronto==0.1.2 jdcal==1.4.1 jedi @ file:///tmp/build/80754af9/jedi_1592841866100/work jeepney @ file:///tmp/build/80754af9/jeepney_1605069705079/work Jinja2==2.11.2 jittor==1.3.1.0 joblib @ file:///tmp/build/80754af9/joblib_1601912903842/work json5==0.9.5 jsonschema @ file:///tmp/build/80754af9/jsonschema_1602607155483/work jupyter==1.0.0 jupyter-client @ file:///tmp/build/80754af9/jupyter_client_1601311786391/work jupyter-console @ file:///tmp/build/80754af9/jupyter_console_1598884538475/work jupyter-contrib-core==0.3.3 jupyter-contrib-nbextensions==0.5.1 jupyter-core==4.6.3 jupyter-highlight-selected-word==0.2.0 jupyter-latex-envs==1.4.6 jupyter-nbextensions-configurator==0.4.1 jupyterlab==2.2.6 jupyterlab-pygments @ file:///tmp/build/80754af9/jupyterlab_pygments_1601490720602/work jupyterlab-server @ file:///tmp/build/80754af9/jupyterlab_server_1594164409481/work keyring @ file:///tmp/build/80754af9/keyring_1601490835422/work kiwisolver @ file:///tmp/build/80754af9/kiwisolver_1604014535162/work lazy-object-proxy==1.4.3 libarchive-c==2.9 line-profiler==3.3.1 llvmlite==0.34.0 lmdb==1.2.1 locket==0.2.0 loguru==0.5.3 lxml @ file:///tmp/build/80754af9/lxml_1603216285000/work Markdown==3.3.4 MarkupSafe==1.1.1 matplotlib @ file:///tmp/build/80754af9/matplotlib-base_1603378225747/work mccabe==0.6.1 memory-profiler==0.58.0 mistune==0.8.4 mkl-fft==1.2.0 mkl-random==1.1.1 mkl-service==2.3.0 mmcls==0.10.0 mmcv-full==1.4.0 -e git+https://github.com/open-mmlab/mmediting.git@2afa00d8cf13582ec9011e5029a07814db6707d8#egg=mmedit -e git+https://github.com/open-mmlab/mmgeneration.git@081b534864896eb419073757060d4f190be78e0f#egg=mmgen mock==4.0.2 more-itertools @ file:///tmp/build/80754af9/more-itertools_1605111547926/work MouseInfo==0.1.3 mpmath==1.1.0 msgpack==1.0.0 multidict==5.1.0 multipledispatch==0.6.0 navigator-updater==0.2.1 nbclient @ file:///tmp/build/80754af9/nbclient_1602783176460/work nbconvert @ file:///tmp/build/80754af9/nbconvert_1601914830498/work nbformat @ file:///tmp/build/80754af9/nbformat_1602783287752/work nest-asyncio @ file:///tmp/build/80754af9/nest-asyncio_1605115881283/work networkx @ file:///tmp/build/80754af9/networkx_1598376031484/work nltk @ file:///tmp/build/80754af9/nltk_1592496090529/work nose==1.3.7 notebook @ file:///tmp/build/80754af9/notebook_1601501575118/work numba @ file:///tmp/build/80754af9/numba_1600100669015/work numexpr==2.7.1 numpy @ file:///tmp/build/80754af9/numpy_and_numpy_base_1603570489231/work numpydoc @ file:///tmp/build/80754af9/numpydoc_1605117425582/work oauthlib==3.1.1 olefile==0.46 omegaconf==2.1.1 onnxruntime==1.9.0 opencv-python==4.5.3.56 openpyxl @ file:///tmp/build/80754af9/openpyxl_1598113097404/work packaging==20.4 pandas @ file:///tmp/build/80754af9/pandas_1602088120436/work pandocfilters @ file:///tmp/build/80754af9/pandocfilters_1605120460739/work parso==0.7.0 partd==1.1.0 path @ file:///tmp/build/80754af9/path_1598376507494/work pathlib2==2.3.5 pathtools==0.1.2 patsy==0.5.1 pep8==1.7.1 pexpect==4.8.0 pickleshare==0.7.5 Pillow @ file:///tmp/build/80754af9/pillow_1603822255246/work pkginfo==1.6.1 platformdirs==2.3.0 pluggy==0.13.1 ply==3.11 portalocker==2.3.2 prettytable==2.2.0 profiler==0.1.0 prometheus-client==0.8.0 promise==2.3 prompt-toolkit @ file:///tmp/build/80754af9/prompt-toolkit_1602688806899/work protobuf==3.18.0 psutil @ file:///tmp/build/80754af9/psutil_1598370257551/work ptyprocess==0.6.0 py @ file:///tmp/build/80754af9/py_1593446248552/work pyasn1==0.4.8 pyasn1-modules==0.2.8 PyAutoGUI==0.9.53 pycocotools==2.0.2 pycodestyle==2.6.0 pycosat==0.6.3 pycparser @ file:///tmp/build/80754af9/pycparser_1594388511720/work pycurl==7.43.0.6 pyDeprecate==0.3.1 pydocstyle @ file:///tmp/build/80754af9/pydocstyle_1598885001695/work pyflakes==2.2.0 PyGetWindow==0.0.9 Pygments @ file:///tmp/build/80754af9/pygments_1604103097372/work pylint==2.11.1 PyMsgBox==1.0.9 pyodbc===4.0.0-unsupported PyOpenGL==3.1.5 PyOpenGL-accelerate==3.1.5 pyOpenSSL @ file:///tmp/build/80754af9/pyopenssl_1594392929924/work pyparsing==2.4.7 pyperclip==1.8.2 PyQt5==5.15.6 PyQt5-Qt5==5.15.2 PyQt5-sip==12.9.0 PyRect==0.1.4 pyrsistent @ file:///tmp/build/80754af9/pyrsistent_1600141720057/work PyScreeze==0.1.28 PySide2==5.15.2 PySocks==1.7.1 pytest==0.0.0 pytest-runner==5.3.1 python-dateutil==2.8.1 python-jsonrpc-server @ file:///tmp/build/80754af9/python-jsonrpc-server_1600278539111/work python-language-server @ file:///tmp/build/80754af9/python-language-server_1600454544709/work python3-xlib==0.15 pytorch-lightning==1.4.8 pytorch3d==0.6.0 pytweening==1.0.4 pytz==2020.1 PyWavelets @ file:///tmp/build/80754af9/pywavelets_1601658317819/work pyxdg @ file:///tmp/build/80754af9/pyxdg_1603822279816/work PyYAML==5.3.1 pyzmq==19.0.2 QDarkStyle==2.8.1 QtAwesome @ file:///tmp/build/80754af9/qtawesome_1602272867890/work qtconsole @ file:///tmp/build/80754af9/qtconsole_1600870028330/work QtPy==1.9.0 redis==3.5.3 regex @ file:///tmp/build/80754af9/regex_1602786672676/work requests @ file:///tmp/build/80754af9/requests_1592841827918/work requests-oauthlib==1.3.0 rope @ file:///tmp/build/80754af9/rope_1602264064449/work rsa==4.7.2 Rtree==0.9.4 ruamel-yaml==0.15.87 ryvencore-qt==0.0.2.8 scikit-image==0.17.2 scikit-learn @ file:///tmp/build/80754af9/scikit-learn_1598376899566/work scipy @ file:///tmp/build/80754af9/scipy_1597686649129/work seaborn @ file:///tmp/build/80754af9/seaborn_1600553570093/work SecretStorage==3.1.2 Send2Trash==1.5.0 sentry-sdk==1.4.1 shiboken2==5.15.2 shortuuid==1.0.1 simplegeneric==0.8.1 singledispatch @ file:///tmp/build/80754af9/singledispatch_1602523705405/work sip==4.19.13 six @ file:///tmp/build/80754af9/six_1605205327372/work smmap==4.0.0 smplpytorch==0.0.8 snowballstemmer==2.0.0 sortedcollections==1.2.1 sortedcontainers==2.2.2 soupsieve==2.0.1 Sphinx @ file:///tmp/build/80754af9/sphinx_1597428793432/work sphinxcontrib-applehelp==1.0.2 sphinxcontrib-devhelp==1.0.2 sphinxcontrib-htmlhelp==1.0.3 sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==1.0.3 sphinxcontrib-serializinghtml==1.1.4 sphinxcontrib-websupport @ file:///tmp/build/80754af9/sphinxcontrib-websupport_1597081412696/work spyder @ file:///tmp/build/80754af9/spyder_1599056981321/work spyder-kernels @ file:///tmp/build/80754af9/spyder-kernels_1599056754858/work SQLAlchemy @ file:///tmp/build/80754af9/sqlalchemy_1603397987316/work statsmodels @ file:///tmp/build/80754af9/statsmodels_1602280205159/work subprocess32==3.5.4 sympy @ file:///tmp/build/80754af9/sympy_1605119542615/work tables==3.6.1 tabulate==0.8.9 tblib @ file:///tmp/build/80754af9/tblib_1597928476713/work tensorboard==2.6.0 tensorboard-data-server==0.6.1 tensorboard-plugin-wit==1.8.0 termcolor==1.1.0 terminado==0.9.1 testpath==0.4.4 threadpoolctl @ file:///tmp/tmp9twdgx9k/threadpoolctl-2.1.0-py3-none-any.whl tifffile==2020.10.1 toml @ file:///tmp/build/80754af9/toml_1592853716807/work toolz @ file:///tmp/build/80754af9/toolz_1601054250827/work torch==1.7.1 torchaudio==0.7.2 torchmetrics==0.5.1 torchvision==0.8.2 tornado==6.0.4 tqdm @ file:///tmp/build/80754af9/tqdm_1602185206534/work traitlets @ file:///tmp/build/80754af9/traitlets_1602787416690/work typing-extensions==3.10.0.2 ujson @ file:///tmp/build/80754af9/ujson_1602523317881/work unicodecsv==0.14.1 urllib3 @ file:///tmp/build/80754af9/urllib3_1603305693037/work uvloop==0.16.0 waitress==2.0.0 wandb==0.12.2 watchdog @ file:///tmp/build/80754af9/watchdog_1593447344699/work wcwidth @ file:///tmp/build/80754af9/wcwidth_1593447189090/work webencodings==0.5.1 Werkzeug==1.0.1 widgetsnbextension==3.5.1 wrapt==1.11.2 wurlitzer @ file:///tmp/build/80754af9/wurlitzer_1594753850195/work xlrd==1.2.0 XlsxWriter @ file:///tmp/build/80754af9/xlsxwriter_1602692860603/work xlwt==1.3.0 xmltodict==0.12.0 yacs==0.1.8 yapf @ file:///tmp/build/80754af9/yapf_1593528177422/work yarl==1.6.3 yaspin==2.1.0 zict==2.0.0 zipp @ file:///tmp/build/80754af9/zipp_1604001098328/work zope.event==4.5.0 zope.interface @ file:///tmp/build/80754af9/zope.interface_1602002420968/work

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
yarkablecommented, Dec 27, 2021

Same problem, unsolved.

0reactions
MaxTeselkincommented, Dec 13, 2022

Setting scope=‘xxx’ worked for me.

Example:

MODELS = Registry('models',
                  build_func=build_model_from_cfg,
                  parent=MMCV_MODELS,
                  scope='xxx')
Read more comments on GitHub >

github_iconTop Results From Across the Web

Source code for mmcv.utils.registry
[docs]def build_from_cfg(cfg: Dict, registry: 'Registry', ... MODELS) >>> # Return a result of the calling function Args: cfg (dict): Config dict.
Read more >
mmdetection源码阅读笔记- JYRoy - 博客园
使用MMDet进行训练和推理设计到的核心组件为MMCV/Registry和MMCV/Runner。 ... while it may introduce unexpected bugs. if isinstance(name, ...
Read more >
mmcv Changelog - pyup.io
mim install mmcv-full. Features ... Update onnx registry (https://github.com/open-mmlab/mmcv/pull/2294) ... Fix unexpected keyword argument for GELU (1847)
Read more >
init | Data Version Control - DVC
Commands such as dvc status and dvc metrics show would produce unexpected results if not constrained to a single project scope.
Read more >
How to train an object detection model with mmdetection
%cd {mmdetection_dir} from mmcv.runner import load_checkpoint from mmdet.apis ... result = inference_detector(model, img) show_result(img, result, model.
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