当前位置: 首页 > news >正文

paddlehub hub TypeError 错误

pip install paddlehub
hub install chinese_ocr_db_crnn_mobile

提示错误:

TypeError: Descriptors cannot be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

遇到问题,没仔细看,就网上搜,https://blog.csdn.net/qq_51447436/article/details/125573273
尝试一: pip install protobuf==3.19.0

提示错误:paddlepaddle 要求 protobuf>=3.20.2 。卸载 protobuf 3.19.0, pip install protobuf 换回来。

尝试二: export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python,错误:

Download https://bj.bcebos.com/paddlehub/paddlehub_dev/chinese_ocr_db_crnn_mobile_1.2.0.zip
[##################################################] 100.00%
Decompress /root/.paddlehub/tmp/tmpmedc4u4e/chinese_ocr_db_crnn_mobile_1.2.0.zip
double free or corruption (out)
Segmentation fault (core dumped)

仔细看错误提示,尝试三:(先退出shell 再进) pip install protobuf==3.20.3, 错误:

File "/usr/local/py311/lib/python3.11/site-packages/paddlehub/utils/xarfile.py", line 109, in __exit__
    raise exit_exception(exit_value)
zlib.error: Error -2 while decompressing data: inconsistent stream state

cd /root/.paddlehub/tmp/tmpmedc4u4e/ ,unzip chinese_ocr_db_crnn_mobile_1.2.0.zip,

Archive:  chinese_ocr_db_crnn_mobile_1.2.0.zip
   creating: chinese_ocr_db_crnn_mobile/
   creating: chinese_ocr_db_crnn_mobile/assets/
  inflating: chinese_ocr_db_crnn_mobile/assets/ppocr_keys_v1.txt  
  inflating: chinese_ocr_db_crnn_mobile/assets/simfang.ttf  
  inflating: chinese_ocr_db_crnn_mobile/character.py  
   creating: chinese_ocr_db_crnn_mobile/inference_model/
   creating: chinese_ocr_db_crnn_mobile/inference_model/angle_cls/
  inflating: chinese_ocr_db_crnn_mobile/inference_model/angle_cls/model.pdiparams  
  inflating: chinese_ocr_db_crnn_mobile/inference_model/angle_cls/model.pdmodel  
   creating: chinese_ocr_db_crnn_mobile/inference_model/character_rec/
  inflating: chinese_ocr_db_crnn_mobile/inference_model/character_rec/model.pdiparams  
  inflating: chinese_ocr_db_crnn_mobile/inference_model/character_rec/model.pdmodel  
  inflating: chinese_ocr_db_crnn_mobile/module.py  
  inflating: chinese_ocr_db_crnn_mobile/README.md  
  inflating: chinese_ocr_db_crnn_mobile/README_en.md  
  inflating: chinese_ocr_db_crnn_mobile/test.py  
  inflating: chinese_ocr_db_crnn_mobile/utils.py  
 extracting: chinese_ocr_db_crnn_mobile/__init__.py  

再次安装,成功: hub install chinese_ocr_db_crnn_mobile

[    INFO] - Successfully installed chinese_ocr_db_crnn_mobile-1.2.0

相关文章:

  • 子宫腺肌症对胚胎着床的影响
  • Android13修改多媒体默认音量
  • 达梦数据库如何收集表和索引的统计信息
  • 信号初相识:Linux 内核的 “隐形使者”
  • 原生家庭独立的艺术:找到自我与家庭的平衡点
  • Grafana使用日志7--开启Sigv4
  • Qt跨线程信号槽调用:为什么信号不能像普通函数那样调用
  • Ubuntu20.04安装Isaac sim/ Isaac lab
  • 分形生成模型
  • 给小白的oracle优化工具,了解一下
  • Docker容器日常维护常用命令大全
  • ds回答-开源llm应用开发平台
  • 【OMCI实践】ONT上线过程的omci消息(七)
  • 使用Fuse-DFS挂载文件存储 HDFS-后端存储ceph
  • Linux Mem -- 关于AArch64 MTE功能的疑问
  • DBGPT安装部署使用
  • python学习六
  • Java进阶——数据类型深入解析
  • DeepSeek本地部署+自主开发对话Web应用
  • Ubuntu 下 nginx-1.24.0 源码分析 - ngx_list_init
  • 常州平台网站建设/seo优化搜索推广
  • 奇趣网做网站/抖音推广渠道有哪些
  • 无网站做cpa推广/公司推广渠道有哪些
  • 平顶山哪里做网站/怎样做百度推广
  • 动态网站 教程/百度学术官网入口网页版
  • 网站建设增值服务/网页广告怎么投放