1?Descriptors cannot not be created directly
????????在運行諸如深度學習python等程序時,如mmdetection、mmdetection3d中的程序,會出現(xiàn)報錯:“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).
? ? ? ? 出現(xiàn)這個問題的主要原因是protobuf版本不匹配。因此,按照錯誤提示,用pip安裝對應版本的protobuf即可,如上述問題中對應的 3.20.1版本。安裝命令為:
pip install protobuf==3.20.1
2?AttributeError: type object 'DialogCode' has no attribute 'Accepted'
? ? ? ? 這個錯誤通常和pyQT組件版本有關,特別是在mayavi使用時會出現(xiàn)該錯誤。詳細報錯內(nèi)容如下:
int(QtGui.QDialog.DialogCode.Accepted): OK,
AttributeError: type object 'DialogCode' has no attribute 'Accepted'
? ? ? ? 解決方式是重新安裝pyqt5,即:文章來源:http://www.zghlxwxcb.cn/news/detail-590322.html
pip install protobuf==pyqt5
?2?AttributeError: type object 'DialogCode' has no attribute 'Accepted'
? ? ? ? 這個錯誤通常和pyQT組件版本有關,特別是在mayavi使用時會出現(xiàn)該錯誤。詳細報錯內(nèi)容如下:
int(QtGui.QDialog.DialogCode.Accepted): OK,
AttributeError: type object 'DialogCode' has no attribute 'Accepted'
? ? ? ? 解決方式是重新安裝pyqt5,即:
pip install protobuf==pyqt5
更多三維、二維感知算法和金融量化分析算法請關注“樂樂感知學堂”微信公眾號,并將持續(xù)進行更新。文章來源地址http://www.zghlxwxcb.cn/news/detail-590322.html
到了這里,關于Descriptors cannot not be created directly的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!