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

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

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
社会演员多的头像社会演员多普通用户
上一篇 2023年3月5日 下午7:16
下一篇 2023年3月5日 下午7:17

相关推荐