表格检测任务(TableBank & Detectron):UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0x80 in position 0: ordinal not in range(128)

我一直在尝试运行一个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_cfgcfg_to_load = ''.join(cfg_to_load.readlines())UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0: ordinal not in range(128)

有谁知道如何解决这个问题吗?任何帮助都将不胜感激。


回答:

我终于解决了!我调整了命令中请求的顺序,所以必须是:

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

推理效果很好!

Related Posts

使用LSTM在Python中预测未来值

这段代码可以预测指定股票的当前日期之前的值,但不能预测…

如何在gensim的word2vec模型中查找双词组的相似性

我有一个word2vec模型,假设我使用的是googl…

dask_xgboost.predict 可以工作但无法显示 – 数据必须是一维的

我试图使用 XGBoost 创建模型。 看起来我成功地…

ML Tuning – Cross Validation in Spark

我在https://spark.apache.org/…

如何在React JS中使用fetch从REST API获取预测

我正在开发一个应用程序,其中Flask REST AP…

如何分析ML.NET中多类分类预测得分数组?

我在ML.NET中创建了一个多类分类项目。该项目可以对…

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注