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.

DensePose KeyError: 'Non-existent config key: MODEL.DENSEPOSE_ON'

See original GitHub issue

To Reproduce

I’m trying to run DensePose with a code block provided in “Detectron2 Tutorial.ipynb.” I tried running this:

from detectron2.engine import DefaultPredictor
from detectron2.config import get_cfg

cfg = get_cfg()
cfg.merge_from_file("./detectron2_repo/projects/DensePose/configs/densepose_rcnn_R_50_FPN_s1x.yaml")
# Find a model from detectron2's model zoo. You can either use the https://dl.fbaipublicfiles.... url, or use the following shorthand

cfg.MODEL.WEIGHTS = "https://dl.fbaipublicfiles.com/densepose/densepose_rcnn_R_50_FPN_s1x/143908701/model_final_dd99d2.pkl"
predictor = DefaultPredictor(cfg)
outputs = predictor(im)

I get:

KeyError                                  Traceback (most recent call last)
<ipython-input-13-c6a881ab918b> in <module>()
      1 cfg = get_cfg()
----> 2 cfg.merge_from_file("./detectron2_repo/projects/DensePose/configs/densepose_rcnn_R_50_FPN_s1x.yaml")
      3 # Find a model from detectron2's model zoo. You can either use the https://dl.fbaipublicfiles.... url, or use the following shorthand
      4 
      5 cfg.MODEL.WEIGHTS = "https://dl.fbaipublicfiles.com/densepose/densepose_rcnn_R_50_FPN_s1x/143908701/model_final_dd99d2.pkl"

4 frames
/usr/local/lib/python3.6/dist-packages/yacs/config.py in _merge_a_into_b(a, b, root, key_list)
    471                 root.raise_key_rename_error(full_key)
    472             else:
--> 473                 raise KeyError("Non-existent config key: {}".format(full_key))
    474 
    475 

KeyError: 'Non-existent config key: MODEL.DENSEPOSE_ON'

Expected behavior

I’m not sure why it’s complaining about this missing key. The provided config file does not have this key, but it looks like DefaultPredictor is looking for it.

Environment

I am using the Google Colab environment.

Please paste the output of python -m detectron2.utils.collect_env.


sys.platform linux Python 3.6.8 (default, Oct 7 2019, 12:59:55) [GCC 8.3.0] Numpy 1.17.3 Detectron2 Compiler GCC 7.4 Detectron2 CUDA Compiler 10.0 DETECTRON2_ENV_MODULE <not set> PyTorch 1.3.0+cu100 PyTorch Debug Build False torchvision 0.4.1+cu100 CUDA available True GPU 0 Tesla P100-PCIE-16GB CUDA_HOME /usr/local/cuda NVCC Cuda compilation tools, release 10.0, V10.0.130 Pillow 4.3.0 cv2 3.4.3


PyTorch built with:

  • GCC 7.3
  • Intel® Math Kernel Library Version 2019.0.4 Product Build 20190411 for Intel® 64 architecture applications
  • Intel® MKL-DNN v0.20.5 (Git Hash 0125f28c61c1f822fd48570b4c1066f96fcb9b2e)
  • OpenMP 201511 (a.k.a. OpenMP 4.5)
  • NNPACK is enabled
  • CUDA Runtime 10.0
  • NVCC architecture flags: -gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_50,code=compute_50
  • CuDNN 7.6.3
  • Magma 2.5.1
  • Build settings: BLAS=MKL, BUILD_NAMEDTENSOR=OFF, BUILD_TYPE=Release, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -fopenmp -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -O2 -fPIC -Wno-narrowing -Wall -Wextra -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-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -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 -Wno-stringop-overflow, DISABLE_NUMA=1, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, USE_CUDA=True, 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, USE_STATIC_DISPATCH=OFF,

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
andrewjongcommented, Nov 21, 2019

Here. It’s not part of the Detectron library itself, but under the demos of this repo. https://github.com/facebookresearch/detectron2/blob/f485b4684c5cf58b53263706be386f57e28d1841/projects/DensePose/densepose/config.py#L7

0reactions
ak9250commented, Dec 29, 2020

@andrewjong could you please share your colab, I am also trying this AssertionError Traceback (most recent call last) <ipython-input-11-e3cb0fa891ed> in <module>() ----> 1 from detectron2_repo.projects.DensePose.densepose.config import add_densepose_config 2 from detectron2.engine import DefaultPredictor 3 from detectron2.config import get_cfg 4 5 cfg = get_cfg()

7 frames /content/detectron2/detectron2/data/catalog.py in register(self, name, func)

AssertionError: Dataset ‘densepose_coco_2014_train’ is already registered!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to run densepose on video with Detectron2
with densepose weights and annotations but Detectron2 gives me this error: Non-existent config key: MODEL.DENSEPOSE_ON.
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