利用torch.utils.tensorboard时出现protobuf的版本不兼容问题

利用torch.utils.tensorboard时出现protobuf的版本不兼容问题:


在用 tensorboard 可视化网络训练过程的 loss 时,出现以下错误:

>>[libprotobuf FATAL google/protobuf/stubs/common.cc:83] This program was compiled against version 3.9.2 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.20.0)

可通过更换 protobuf 的版本来解决这个问题,具体操作如下:

>> pip uninstall protobuf
>> pip install protobuf==3.9.2

  • 6
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
D:\anaconda\envs\pytorch\python.exe C:\Users\23896\Desktop\bev-lane-det_dachaung-master\tools\train_openlane.py Traceback (most recent call last): File "C:\Users\23896\Desktop\bev-lane-det_dachaung-master\tools\train_openlane.py", line 18, in <module> from torch.utils.tensorboard import SummaryWriter File "D:\anaconda\envs\pytorch\lib\site-packages\torch\utils\tensorboard\__init__.py", line 13, in <module> from .writer import FileWriter, SummaryWriter # noqa: F401 File "D:\anaconda\envs\pytorch\lib\site-packages\torch\utils\tensorboard\writer.py", line 9, in <module> from tensorboard.compat.proto.event_pb2 import SessionLog File "D:\anaconda\envs\pytorch\lib\site-packages\tensorboard\compat\proto\event_pb2.py", line 17, in <module> from tensorboard.compat.proto import summary_pb2 as tensorboard_dot_compat_dot_proto_dot_summary__pb2 File "D:\anaconda\envs\pytorch\lib\site-packages\tensorboard\compat\proto\summary_pb2.py", line 17, in <module> from tensorboard.compat.proto import tensor_pb2 as tensorboard_dot_compat_dot_proto_dot_tensor__pb2 File "D:\anaconda\envs\pytorch\lib\site-packages\tensorboard\compat\proto\tensor_pb2.py", line 16, in <module> from tensorboard.compat.proto import resource_handle_pb2 as tensorboard_dot_compat_dot_proto_dot_resource__handle__pb2 File "D:\anaconda\envs\pytorch\lib\site-packages\tensorboard\compat\proto\resource_handle_pb2.py", line 16, in <module> from tensorboard.compat.proto import tensor_shape_pb2 as tensorboard_dot_compat_dot_proto_dot_tensor__shape__pb2 File "D:\anaconda\envs\pytorch\lib\site-packages\tensorboard\compat\proto\tensor_shape_pb2.py", line 36, in <module> _descriptor.FieldDescriptor( File "D:\anaconda\envs\pytorch\lib\site-packages\google\protobuf\descriptor.py", line 561, in __new__ _message.Message._CheckCalledFromGeneratedFile() 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).
07-20
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值