Skip to main content
 首页 » 编程设计

python之Protobuf 编译问题

2025年02月15日8freeliver54

我一直在尝试运行 TensorFlow 库,为此我必须编译 Protobuf 库。我正在使用以下命令:

C:\tensorflow-master\tensorflow\models>protoc object_detection/protos/*.proto --python_out=. 

出现以下错误:

'protoc' is not recognized as an internal or external command, 

可运行的程序或批处理文件。

我不确定这里的问题是什么。我正在从 TensorFlow 模型目录中运行它,但它仍然无法识别协议(protocol)。

请您参考如下方法:

您需要先安装 Protocols 缓冲库。

从命令行进行 pip 安装,如下所示:

pip install protobuf 

然后再次运行你的协议(protocol)命令