DensePose KeyError: 'Non-existent config key: MODEL.DENSEPOSE_ON'
See original GitHub issueTo 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:
- Created 4 years ago
- Comments:5
Top GitHub Comments
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
@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!