Задача обнаружения таблицы (TableBank & Detectron): UnicodeDecodeError: кодек «ascii» не может декодировать байт 0x80 в позиции 0: порядковый номер не в диапазоне (128) - PullRequest
0 голосов
/ 17 мая 2019

Я пытался запустить скрипт Python для тестирования предварительно обученной модели (ResNeXt-101) и визуализации производительности задачи обнаружения таблиц, предложенной TableBank. Авторы провели предварительную подготовку модели с использованием библиотеки Detectron (программная система Facebook AI Research (FAIR), которая реализует современные алгоритмы обнаружения объектов, в том числе Mask R-CNN). Я следовал этому уроку: https://github.com/doc-analysis/TableBank/blob/master/TestPretrainedModel.md

Это моя команда:

python tools/infer_simple.py --cfg /home/xxxx/ModelResNeXt101.pkl --output-dir /tmp/detectron-tablebank --image-ext jpg --wts /home/xxxx/config_X101.yaml /home/xxxx/TableBank/data/Sampled_Detection_data/Latex/images

Я получаю следующее:

Found Detectron ops lib: /home/xxxx/.local/lib/python2.7/site-packages/torch/lib/libcaffe2_detectron_ops_gpu.so
[E init_intrinsics_check.cc:43] CPU feature avx is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
[E init_intrinsics_check.cc:43] CPU feature avx2 is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
[E init_intrinsics_check.cc:43] CPU feature fma is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
Traceback (most recent call last):
  File "tools/infer_simple.py", line 185, in <module>
    main(args)
  File "tools/infer_simple.py", line 125, in main
    merge_cfg_from_file(args.cfg)
  File "/detectron/detectron/core/config.py", line 1146, in 
    merge_cfg_from_file
    yaml_cfg = AttrDict(load_cfg(f))
  File "/detectron/detectron/core/config.py", line 1133, in load_cfg
cfg_to_load = ''.join(cfg_to_load.readlines())
UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0: ordinal not in range(128)

Кто-нибудь знает, как решить эту проблему? Любая помощь приветствуется.

1 Ответ

0 голосов
/ 21 мая 2019

Я наконец получил это! Я поменял местами последовательность запросов в команде, поэтому она должна быть:

python detectron/tools/infer_simple.py --wts /home/arij_sediri/ModelResNeXt152.pkl --output-dir /tmp/detectron-tablebank --image-ext jpg --cfg /home/arij_sediri/config_X152.yaml /home/arij_sediri/TableBank/TableBank/data/Sampled_Detection_data/Latex/images

Хороший вывод!

...