Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Error during Inference in Wild: yaml.constructor.ConstructorError: while constructing a Python instance #93

Closed
ROODAY opened this issue Oct 24, 2019 · 1 comment

Comments

@ROODAY
Copy link

ROODAY commented Oct 24, 2019

I followed the instructions for Inference in the wild but I ran into an issue on step 3. I run the following command in the root directory of the Detectron project:

python3 tools/infer_video.py \
--cfg configs/12_2017_baselines/e2e_keypoint_rcnn_R-101-FPN_s1x.yaml \
--output-dir ../video_output \
--image-ext mp4 \
--wts models/model_final.pkl \
../video_input

and I run into the following error:

Traceback (most recent call last):
  File "tools/infer_video.py", line 100, in <module>
    main(args)
  File "tools/infer_video.py", line 49, in main
    model = infer_engine.initialize_model_from_cfg(args.weights)
  File "/project/dnn-motion/kakashi/detectron/detectron/core/test_engine.py", line 329, in initialize_model_from_cfg
    model, weights_file, gpu_id=gpu_id,
  File "/project/dnn-motion/kakashi/detectron/detectron/utils/net.py", line 65, in initialize_gpu_from_weights_file
    saved_cfg = load_cfg(src_blobs['cfg'])
  File "/project/dnn-motion/kakashi/detectron/detectron/core/config.py", line 1145, in load_cfg
    return envu.yaml_load(cfg_to_load)
  File "/usr4/cs640/rooday/.local/lib/python3.7/site-packages/yaml/__init__.py", line 114, in load
    return loader.get_single_data()
  File "/usr4/cs640/rooday/.local/lib/python3.7/site-packages/yaml/constructor.py", line 43, in get_single_data
    return self.construct_document(node)
  File "/usr4/cs640/rooday/.local/lib/python3.7/site-packages/yaml/constructor.py", line 47, in construct_document
    data = self.construct_object(node)
  File "/usr4/cs640/rooday/.local/lib/python3.7/site-packages/yaml/constructor.py", line 94, in construct_object
    data = constructor(self, tag_suffix, node)
  File "/usr4/cs640/rooday/.local/lib/python3.7/site-packages/yaml/constructor.py", line 635, in construct_python_object_new
    return self.construct_python_object_apply(suffix, node, newobj=True)
  File "/usr4/cs640/rooday/.local/lib/python3.7/site-packages/yaml/constructor.py", line 618, in construct_python_object_apply
    value = self.construct_mapping(node, deep=True)
  File "/usr4/cs640/rooday/.local/lib/python3.7/site-packages/yaml/constructor.py", line 210, in construct_mapping
    return super().construct_mapping(node, deep=deep)
  File "/usr4/cs640/rooday/.local/lib/python3.7/site-packages/yaml/constructor.py", line 135, in construct_mapping
    value = self.construct_object(value_node, deep=deep)
  File "/usr4/cs640/rooday/.local/lib/python3.7/site-packages/yaml/constructor.py", line 99, in construct_object
    for dummy in generator:
  File "/usr4/cs640/rooday/.local/lib/python3.7/site-packages/yaml/constructor.py", line 404, in construct_yaml_map
    value = self.construct_mapping(node)
  File "/usr4/cs640/rooday/.local/lib/python3.7/site-packages/yaml/constructor.py", line 210, in construct_mapping
    return super().construct_mapping(node, deep=deep)
  File "/usr4/cs640/rooday/.local/lib/python3.7/site-packages/yaml/constructor.py", line 135, in construct_mapping
    value = self.construct_object(value_node, deep=deep)
  File "/usr4/cs640/rooday/.local/lib/python3.7/site-packages/yaml/constructor.py", line 94, in construct_object
    data = constructor(self, tag_suffix, node)
  File "/usr4/cs640/rooday/.local/lib/python3.7/site-packages/yaml/constructor.py", line 624, in construct_python_object_apply
    instance = self.make_python_instance(suffix, node, args, kwds, newobj)
  File "/usr4/cs640/rooday/.local/lib/python3.7/site-packages/yaml/constructor.py", line 570, in make_python_instance
    node.start_mark)
yaml.constructor.ConstructorError: while constructing a Python instance
expected a class, but found <class 'builtin_function_or_method'>
  in "<unicode string>", line 3, column 20:
      BBOX_XFORM_CLIP: !!python/object/apply:numpy.core ...

I'm not sure what this means/which file is causing an issue, could someone shed some light?

@ROODAY
Copy link
Author

ROODAY commented Oct 24, 2019

Solved using this solution.

@ROODAY ROODAY closed this as completed Oct 24, 2019
@ROODAY ROODAY changed the title Issue with inference in detectron Error during Inference in Wild: yaml.constructor.ConstructorError: while constructing a Python instance Oct 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant