Cannot find `protoc` command

天大地大妈咪最大 提交于 2019-12-10 11:25:41

问题


When I run this:

protoc --python_out=. .\object_detection\protos\anchor_generator.proto

on a tensorflow object detection file on the command line, I get:

'protoc' is not recognized as an internal or external command, operable program or batch file.

I followed all instructions in protoc object_detection/protos/*.proto: No such file or directory, but they never worked for me

In addition to the searches I made, I tried this command:

py-3.6 -m pip install protobuf

and it works for me.

I typed the command again

python_out=. .\object_detection\protos\anchor_generator.proto 

But it still fails and this:

C:\Users\laptop market\Downloads\bin\protoc object_detection/protos/*.proto --py_out=.

also fails.


回答1:


Hey I got the solution you have to save the protoc.exe file which is located in the bin file to C:\Users\Satyarth\AppData\Local\Programs\Python\Python36\Scripts and it will solve the problem and if it still not give the above path to the enviroment variables and it will surely help that. Change the "Satyarth" from the path and use yours




回答2:


Better you just go to this directory: https://www.github.com/google/protobuf/releases

then just download the protoc.py file which suits your OS virsion and extract that one. you will get a protoc.exe file, then place it on your local machine




回答3:


Depending on your platform, you might have to install protobuf locally. See the docs for more detailed instructions.




回答4:


First of all consider installing Protobuf Compiler inside the C:\Program Files folder. Then you need to compile protobuf every time you want to use Tensorflow Object Detection API. To do this, open cmd in the ../models/research directory and run

“C:\Program Files\protoc-<PROTO_VERSION>\bin\protoc.exe” object_detection/protos/*.proto --python_out=.

where <PROTO_VERSION> is the version of protobuf compiler, you're using (for example protoc-3.5.1-win64 or the name of the folder you've picked for the protobuf).

Be advised, that you should compile protobuf in the every cmd window that is launched to work with Object Detection.



来源:https://stackoverflow.com/questions/52929161/cannot-find-protoc-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!