ibm-aur-nlp / PubLayNet

Other
900 stars 165 forks source link

yaml.scanner.ScannerError: mapping values are not allowed here #35

Open nsage-creatively opened 3 years ago

nsage-creatively commented 3 years ago

Trying to run Detectron's inference demo with the PubLayNet models and .yaml configs.

My exact command is:

python demo.py --config-file ../models/e2e_faster_rcnn_X-101-64x4d-FPN_1x.yaml \ --input ../images/sample_image.png \ --opts MODEL.WEIGHTS ../dir2/models/Faster-RCNN.pkl

The full traceback is this:

[04/08 20:23:44 detectron2]: Arguments: Namespace(config_file='../models/e2e_faster_rcnn_X-101-64x4d-FPN_1x.yaml', webcam=False, video_input=None, input=['../images/Page 0.png'], output=None, confidence_threshold=0.5, opts=['MODEL.WEIGHTS', '../models/Faster-RCNN.pkl'])
Traceback (most recent call last):
  File "../detectron2/demo/demo.py", line 80, in <module>
    cfg = setup_cfg(args)
  File "../Documents/detectron2/demo/demo.py", line 26, in setup_cfg
    cfg.merge_from_file(args.config_file)
  File "../anaconda3/envs/pytorch_env/lib/python3.9/site-packages/detectron2/config/config.py", line 31, in merge_from_file
    loaded_cfg = self.load_yaml_with_base(cfg_filename, allow_unsafe=allow_unsafe)
  File "../anaconda3/envs/pytorch_env/lib/python3.9/site-packages/fvcore/common/config.py", line 61, in load_yaml_with_base
    cfg = yaml.safe_load(f)
  File "../anaconda3/envs/pytorch_env/lib/python3.9/site-packages/yaml/__init__.py", line 162, in safe_load
    return load(stream, SafeLoader)
  File "../anaconda3/envs/pytorch_env/lib/python3.9/site-packages/yaml/__init__.py", line 114, in load
    return loader.get_single_data()
  File "../anaconda3/envs/pytorch_env/lib/python3.9/site-packages/yaml/constructor.py", line 49, in get_single_data
    node = self.get_single_node()
  File "../anaconda3/envs/pytorch_env/lib/python3.9/site-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "../anaconda3/envs/pytorch_env/lib/python3.9/site-packages/yaml/composer.py", line 58, in compose_document
    self.get_event()
  File "../anaconda3/envs/pytorch_env/lib/python3.9/site-packages/yaml/parser.py", line 118, in get_event
    self.current_event = self.state()
  File "../anaconda3/envs/pytorch_env/lib/python3.9/site-packages/yaml/parser.py", line 193, in parse_document_end
    token = self.peek_token()
  File "../anaconda3/envs/pytorch_env/lib/python3.9/site-packages/yaml/scanner.py", line 129, in peek_token
    self.fetch_more_tokens()
  File "../anaconda3/envs/pytorch_env/lib/python3.9/site-packages/yaml/scanner.py", line 223, in fetch_more_tokens
    return self.fetch_value()
  File "../anaconda3/envs/pytorch_env/lib/python3.9/site-packages/yaml/scanner.py", line 577, in fetch_value
    raise ScannerError(None, None,
yaml.scanner.ScannerError: mapping values are not allowed here

My brief bits of research didn't turn up much more than this syntactical mistake.

I did a brief search through the .yaml to see if this was occurring, but I didn't see anything. Maybe I missed something, or my prompt is somehow wrong. Let's discuss.

I'm using Python 3.9.2 and detectron2 v0.4.