Descriptors cannot not be created directly

这篇具有很好参考价值的文章主要介绍了Descriptors cannot not be created directly。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

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

更多三维、二维感知算法和金融量化分析算法请关注“乐乐感知学堂”微信公众号,并将持续进行更新。文章来源地址https://www.toymoban.com/news/detail-590322.html

到了这里,关于Descriptors cannot not be created directly的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • git fatal: ‘xxx‘ is not a commit and a branch ‘xxx‘ ‘ cannot be created from it

    当拉取一个git远程仓库分支时报错: 命令:git checkout -b 本地分支名 远程分支名 报错:fatal: \\\'origin/dev_v2.8.4_v10.74.1\\\' is not a commit and a branch \\\'dev_v2.8.4_v10.74.1\\\' cannot be created from it 远程新建的分支没有更新到本地。实际上,git仓库分为本地仓库和远程仓库,我们用 checkout 命令是从本

    2024年02月10日
    浏览(34)
  • 【Git报错】fatal: ‘origin/XXX‘ is not a commit and a branch ‘XXX‘ cannot be created from it

    发现问题 远程已有分支,本地需要新建对应分支,于是执行命令: git checkout --track origin/XXX 时报错。 原因: 远程真的没有这个分支,所以失败 这个情况没什么好说的 远程有这个分支,但是本地认为远程没有这个分支 执行如下命令,查看本地缓存的所有远程分支,看看你要

    2024年02月16日
    浏览(37)
  • git拉取远程分支到本地报错fatal: ‘origin/XXX‘ is not a commit and a branch ‘XXX‘ cannot be created from it

    远程已有分支,本地需要新建对应分支,报下面错误 原因: 远程真的没有这个分支,所以失败 远程有这个分支,但是本地认为远程没有这个分支 执行 git branch -r 命令,查看本地缓存的所有远程分支 输出显示远程并没有要拉取的分支,但是实际上远程仓库是有该分支的,从

    2024年02月15日
    浏览(35)
  • elasticsearch启动报max file descriptors [65535]

    环境centos7   es版本elasticsearch-5.4.0 今天安装es,启动一直报ERROR: bootstrap checks failed max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536] 第一检查这三个文件是否配置正确  vim  /etc/security/limits.conf vim /etc/profile   把ulimit注释掉 修改 /etc/sysctl.conf 添加配置:

    2024年02月15日
    浏览(28)
  • SQLIntegrityConstraintViolationException: Column ‘create_time‘ cannot be null

    在使用MySQL + MyBatis时遇到的问题,记录一下。 在测试环境里,往MySQL数据表里插入数据时报错: SQLIntegrityConstraintViolationException: Column \\\'create_time\\\' cannot be null 表结构字段定义: 备注: MySQL数据库版本: 使用的MyBatis版本: 使用的MySQL驱动版本: 参考mysql-insert-error-cannot-be-null-

    2024年02月01日
    浏览(53)
  • Ubuntu18.04修改file descriptors(文件描述符限制),解决elasticsearch启动报错问题

    最近在学习elasticsearch,使用的平台是Ubuntu18.04,在部署过程中的坑记录一下。 下载安装的过程就不说了,在启动es的时候报错 1 max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535] 看了下网上给的解决方案都是修改vim /etc/security/limits.conf,添加配置 1 2 * s

    2024年02月13日
    浏览(34)
  • elastic安装报错:max file descriptors [4096] for elasticsearch process is too low, increase to at least

    一、现象 因为 es 不允许使用root用户安装,在使用新建的es用户安装的时候报错如下, max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535] 二、解决办法 将当前用户的软硬限制调大。找到文件 /etc/security/limits.conf ,编辑,在文件的最后追加如下配置:  

    2024年02月11日
    浏览(28)
  • Warning: Could not create server TCP listening socket Cannot assign request

    一、问题:docker部署redis时发现docker ps命令查看redis端口号为空  二、原因:在网上查找基本都是6379端口被占用 三、解决方法 1、先docker stop停掉redis容器 2、通过修改redis挂载在linux上的redis.conf文件,将bind 127.0.0.1ip地址放开,之前注释掉了。 bind 127.0.0.1 这个是绑定了我们的主

    2024年02月03日
    浏览(47)
  • ERROR: Network tsg declared as external, but could not be found. Please create the network manually

    docker第一次安装,然后在用docker-compose up -d部署redis时出现这个错误,就按照它的提示,使用docker network create tsg命令,再次执行部署成功。      

    2024年02月11日
    浏览(63)
  • ERROR: Could not build wheels for pycocotools which use PEP 517 and cannot be installed directl

    安装yolov5依赖库时,最后pycocotools报错 重点是以下原因: error: Microsoft Visual C++ 14.0 or greater is required. Get it with \\\"Microsoft C++ Build Tools\\\": https://visualstudio.microsoft.com/visual-cpp-build-tools/ 尝试的解决方法如下: 1、直接下载VS2022中,工作负荷里有关C++和Python的(未成功) 结果报错 vs2

    2024年02月02日
    浏览(35)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包