PaddleHub运行错误:ModuleNotFoundError: No module named ‘Polygon‘

Posted 没刮胡子

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PaddleHub运行错误:ModuleNotFoundError: No module named ‘Polygon‘相关的知识,希望对你有一定的参考价值。

问题描述

  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/root/.paddlehub/modules/ocr_det/module.py", line 32, in <module>
    from tools.infer.predict_det import TextDetector
  File "./tools/infer/predict_det.py", line 31, in <module>
    from ppocr.data import create_operators, transform
  File "./ppocr/data/__init__.py", line 35, in <module>
    from ppocr.data.imaug import transform, create_operators
  File "./ppocr/data/imaug/__init__.py", line 47, in <module>
    from .ct_process import *
  File "./ppocr/data/imaug/ct_process.py", line 22, in <module>
    import Polygon as plg
ModuleNotFoundError: No module named 'Polygon'

解决方案

安装模块

pip install Polygon3 -i https://pypi.tuna.tsinghua.edu.cn/simple

# 安装第三方库依赖
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

以上是关于PaddleHub运行错误:ModuleNotFoundError: No module named ‘Polygon‘的主要内容,如果未能解决你的问题,请参考以下文章

基于百度paddlehub的人脸口罩检测

PaddleHub人像分割模型:AI人像抠图及图像合成

Gitlab CI Python运行测试-ModuleNotFoundError:没有名为xxx的模块

简陋Web应用2人脸检测——基于Flask和PaddleHub

Python初级人工智能精讲用Paddlehub给一段没有标点符号的文字加上合适的标点符号

PaddleHub--飞桨预训练模型应用工具{风格迁移模型词法分析情感分析Fine-tune API微调}