gpt4 book ai didi

python-3.x - Protobuf 运行时警告 : Unexpected end-group tag Not all data was converted

转载 作者:行者123 更新时间:2023-12-05 07:15:13 25 4
gpt4 key购买 nike

我有这个 utf-8 编码的文件,我需要从中收集 protobuf 可行的十六进制转储,然后将其提供给 protobuf。.proto 文件按预期工作,生活几乎完美。

message_content = message_content.replace(" ","")
message_content = binascii.unhexlify(message_content)

我将字符串转换为原始字节,然后将其提供给 protobuf

msg.ParseFromString(message_content)

从哪里产生错误

 RuntimeWarning: Unexpected end-group tag: Not all data was converted
msg.ParseFromString(message_content)

我不知道是我收集的十六进制部分不好还是损坏了。message_content 看起来像这样:

b"87\x00\x00C\x17\x11\x10j\x17\x11\x10\x0c\x00\xc2\x00\x08\xec\xad\xe8\xe0\xf9\x04\x10\x01\x1a\x1f\x08\xea\xae\x18\x12\x14\x01\x00\x0f\x00\x02\x02|\xf0%\x00\x01&\x00\x01'\x00\x01*\x00\x01*\x01\x00\x1a\x00\x1a \x08\xea\xae\x14\x12\x14\x01\x00\x0f\x00\x02\x02|\xf0%\x00\x01&\x00\x01'\x00\x01(\x00\x01*\x02\x00\x00\x1a\x00\x1a#\x08\xea.\x12\x14\x01\x00\x0f\x00\x02\x02|\xf0%\x00\x01&\x00\x011\x00\x012\x00\x01*\x06\x00\x00\x00\x00\x00\x00\x1a\x00\x1a \x08\xea\xae\x14\x12\x14\x01\x00\x0f\x00\x02\x02|\xf0%\x00\x01&\x00\x01'\x00\x01(\x00\x02*\x02\x00\x00\x1a\x00\x1a\x1d\x08\xea\xae\x0c\x12\x11\x01\x00\x0f\x00\x02\x02|\xf0%\x00\x01&\x00\x011\x00\x01*\x02\x00\x00\x1a\x00"

最佳答案

我遇到了类似的问题。最后发现上游源提供的数据有问题。也可以检查是不是base64数据源有问题。

关于python-3.x - Protobuf 运行时警告 : Unexpected end-group tag Not all data was converted,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59642219/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com