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).
运行train.py 出现上述报错,解决方法,按照提示将protobuf包降一下版本,即重新安装
pip install protobuf==3.20.1
安装成功再运行即可。
安装成功后,我的界面显示新版本protobuf和onnx包不适配。所以我的protobuf包忽然出问题应该是我昨天安装了onnx包
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
onnx 1.14.1 requires protobuf>=3.20.2, but you have protobuf 3.20.1 which is incompatible.
Successfully installed protobuf-3.20.1