1 Descriptors cannot not be created directly

在运行诸如深度学习python等程序时,如mmdetection、mmdetection3d中的程序,会出现报错:“Descriptors cannot not be created directly”。详细报错如下:

TypeError: Descriptors cannot not 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).

TypeError: Descriptors cannot not 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).

出现这个问题的主要原因是protobuf版本不匹配。因此,按照错误提示,用pip安装对应版本的protobuf即可,如上述问题中对应的 3.20.1版本。安装命令为:

pip install protobuf==3.20.1

2 AttributeError: type object 'DialogCode' has no attribute 'Accepted'

这个错误通常和pyQT组件版本有关,特别是在mayavi使用时会出现该错误。详细报错内容如下:

int(QtGui.QDialog.DialogCode.Accepted): OK,
AttributeError: type object 'DialogCode' has no attribute 'Accepted'

解决方式是重新安装pyqt5,即:

pip install protobuf==pyqt5

2 AttributeError: type object 'DialogCode' has no attribute 'Accepted'

这个错误通常和pyQT组件版本有关,特别是在mayavi使用时会出现该错误。详细报错内容如下:

int(QtGui.QDialog.DialogCode.Accepted): OK,
AttributeError: type object 'DialogCode' has no attribute 'Accepted'

解决方式是重新安装pyqt5,即:

pip install protobuf==pyqt5

更多三维、二维感知算法和金融量化分析算法请关注“乐乐感知学堂”微信公众号,并将持续进行更新。

Descriptors cannot not be created directly相关推荐

  1. TypeError: Descriptors cannot not be created directly.

    python 依赖 protobuf 奇怪报错 TypeError: Descriptors cannot not be created directly. 在使用 paddlex 时引入一些调用了 ...

  2. python TypeError: Descriptors cannot not be created directly错误解决

    运行python脚本时出现错误 TypeError: Descriptors cannot not be created directly. If this call came from a _pb2 ...

  3. TypeError: Descriptors cannot not be created directly解决

    文章目录 问题 解决 问题 跑代码的时候遇到了这个问题: TypeError: Descriptors cannot not be created directly. If this call cam ...

  4. TensorFlow2.8.0报错TypeError: Descriptors cannot not be created directly.

    @创建于:2022.09.28 @修改于:2022.09.28 1.错误信息 Traceback (most recent call last):File "D:\PycharmProjec ...

  5. import keras时遇到的错误 TypeError: Descriptors cannot not be created directly. If this call came from a _

    问题描述 版本对应 keras 与 tensorflow 版本对应关系:https://master–floydhub-docs.netlify.app/guides/environments/ 本文 ...

  6. 关于Descriptors cannot not be created directly报错

    报错信息为: TypeError: Descriptors cannot not be created directly. If this call came from a _pb2.py file, ...

  7. 09 TypeError: Descriptors cannot not be created directly.

    1.问题: import yaml ModuleNotFoundError: No module named 'yaml' yaml模块的pip工具包名称不是yaml,而是pyyaml,所以不是直接p ...

  8. 解决:TypeError: Descriptors cannot not be created directly

    我使用pip命令下载安装paddlepaddle库,具体命令如下所示,采用清华镜像源,这样下载速度更快! pip install -i https://pypi.tuna.tsinghua.edu.c ...

  9. Python报错 TypeError: Descriptors cannot not be created directly

    Python报错TypeError: Descriptors cannot not be created directly 具体错误: TypeError: Descriptors cannot no ...

最新文章

  1. yolo如何降低loss_从未看过如此通俗易懂的YOLO系列
  2. NLTK命名实体识别NER
  3. 实战SSM_O2O商铺_31【商品】商品添加之View层的实现
  4. 简明docker教程 1
  5. javaweb学习总结(五):Servlet开发(一)
  6. Codeforces Round #588 (Div. 2) D. Marcin and Training Camp 思维
  7. Intel 64/x86_64/IA-32/x86处理器通用寄存器 (2) - 64位通用寄存器
  8. 一行能装逼的JavaScript代码,就是怎么sao
  9. ios app开发简单实例--源代码管理的基本操作
  10. 3.13PMP试题每日一题
  11. java基础总结06-常用api类-System类常用方法
  12. python将输出结果写入csv_Python怎么把输出整体写入CSV文件
  13. C++解析char *p与char p[]
  14. 字节跳动A/B实验背后的秘密:样本量计算
  15. Git 常用回滚撤销命令总结
  16. 【关于听任大佬的讲话的深刻感悟】
  17. Apple 授权登录
  18. Nodejs+express+vue+Elementui酒店客房管理系统
  19. 计算机整体硬盘销毁,如何完全销毁硬盘上的数据?
  20. glDrawElements 绘制立方体共用顶点的法线和UV处理

热门文章

  1. linux 备份文件滚动删除
  2. JFreeChart饼状图显示数字
  3. Java面试之场景题汇总
  4. 【亲测 | 007】易搜资料 V2.4.3版本 非独立版 亲测无错 | 极致技术工厂
  5. 卡车智能驾驶进入“后法规”时代
  6. python读取excel的路径
  7. 基于react的影院购票应用
  8. (HOTA)多目标跟踪MOT指标计算方法
  9. 技术型公司与非技术型公司区别
  10. 167 The Sultan's Successors