Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find `protoc` command

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.

like image 204
m.mera Avatar asked Oct 22 '18 12:10

m.mera


People also ask

Where can I find protoc?

You can get it by downloading the corresponding file for your system from https://github.com/google/protobuf/releases. (The corresponding file will be named something like protoc-*-.

What is protoc command?

protoc is a compiler for protocol buffers definitions files. It can can generate C++, Java and Python source code for the classes defined in PROTO_FILE.


3 Answers

The way I solved the issue on Windows 10 was to

  1. copy the protoc file https://github.com/protocolbuffers/protobuf/releases/download/v3.12.4/protoc-3.12.4-win64.zip from the link https://github.com/protocolbuffers/protobuf/releases
  2. Extract the contents of the zip file.
  3. Bin directory contains the protoc.exe
  4. Update the environment variable to point to the bin directory that contains the protoc.exe
  5. Re-Open the cmd as the environment variable take effect only on new command window
  6. run protoc object_detection/protos/*.proto --python_out=.
like image 110
Renu Avatar answered Sep 24 '22 04:09

Renu


My solution for windows:

  • Download protoc-3.18.0-win64.zip from here
  • Extract zip and Copy proto.exe from bin directory and paste it in models/research folder
  • Then run this command protoc object_detection/protos/*.proto --python_out=.
like image 28
Sravya Yellapragada Avatar answered Sep 23 '22 04:09

Sravya Yellapragada


I also encountered this error a while ago To go around this: Follow the steps listed below:

  1. Install the protoc which is applicable for your operating system from this github repo for me it was
    protoc-3.13.0-win64.zip

  2. Extract the zip file and put it in a folder where it will be permanently there

  3. Go to the bin folder present in the protocFolder in my case I had to go to
    F:\Programing_stuff\ML\protoc-3.17.3-win64\bin or just find where the protoc.exe file is and copy the path

  4. Then in the windows search bar type path and click on Edit the system environment variables

  5. And the path of the bin folder

Hope this helps, If doesn't check this video Or this website (If you want to install TensorFlow)

like image 20
Prathamesh Bhatkar Avatar answered Sep 22 '22 04:09

Prathamesh Bhatkar