object_detection/protos/*.proto: No such file or directory
As mentioned above the error takes place in while executing the command in the windows cmd prompt.
D:/BB/bin/protoc object_detection/protos/*.proto --python_out=.
as for the reference in the installation process of object detection in this model.
in protobuf compilation.
This is a typical bug of the object detection module working in Windows. Here are detailed discussion #1591.
A solution is to compile those .proto files one by one. You can write a batch to run.
@Hemanth2396 Indeed there is a problem with version 3.5.0 of protobuf on Windows. This line works fine for me using version 3.4.0. Get it from here: https://github.com/google/protobuf/releases/tag/v3.4.0
@Hemanth2396 , do these suggestions resolve your issues? either writing a batch file, using 3.4 instead of 3.5, and the info on #1591?
I have try 3.4 but it also doesn't work. Has anyone solved the problem?
I have solved the problem. My mistake occurs because the directory of the files has been updated. So we should run cmd in 'research' file instead of 'models' file. I hope that helps.
i have the same problem . but after i install protobuff 3.4 , the error message become :Invalid argument . can anyone give a suggestion?
@Rulen9987 I also have the same or a similar issue.
I have tried using proto 3.4 and 3.5 to compile the .proto files individually with similar results however it appears there are dependencies between each proto file. I believe the dependencies are enumerated in the BUILD file but I'm not clear on how to use this file to control the order that proto builds.
Edit: I may have resolved the issue!
The directory structure for includes is fixed inside of each proto file e.g. anchor_generator.proto lives at "object_detection/protos/anchor_generator.proto".
This means that every time anchor_generator.proto calls an import like...
import "object_detection/protos/grid_anchor_generator.proto";
...it recurses from its pwd and cannot find the appropriate include.
I moved protoc.exe to "\models\models-master\research" and used...
protoc --python_out=. object_detection\protos\*.proto
...without any errors. This was with protoc 3.4 but I suspect 3.5 should be the same. This is likely not an issue with protoc but rather how directories should be referenced in Windows.
Edit: Edit: I changed the example proto file to the first one that will throw an error when a user tries to follow https://pythonprogramming.net/introduction-use-tensorflow-object-detection-api-tutorial/ so that it shows up more frequently when people search for that error
Same issue on my windows10 and anaconda3, i had install protoc3.4
With windows try running it separately. I had the same issue but running it one by one seems to work
ie protoc object_detection/protos/anchor_generator.proto --python_out=.
This is my solution:
Head to the protoc releases page and download the protoc-3.4.0-win32.zip, extract it, and you will find protoc.exe in the bin directory.
Move this to models/research folder tensorflow model project
Next,you can use the protoc command like
protoc object_detection/protos/*.proto --python_out=.
protoc-3.5.0-win32.zip is the source of the problem. I read everything in the protoc manuel but didnt figure the solution. but when I changed to protoc-3.4.0-win32 and put the protoc.exe into the research folder(in which I have object_detection folder). Run cmd protoc object_detection/protos/*.proto --python_out=. in the research folder and then no errors is reported, meaning successful compilation.
I installed protoc-3.4.0-win32.zip and this error was fixed. run cmd
[PATH TO PROTOC.EXE]/protoc object_detection/protos/*.proto --python_out=.
I used following powershell command on windows:
Get-ChildItem object_detection/protos/*.proto | Resolve-Path -Relative | %{ .\protoc $_ --python_out=. }
Thanks @obabac. That did the trick.
I installed v3.4.0 and it solved the issue
After 60 hour's trials and errors, I finally succeeded in compiling the Protobuf libraries.
I like to share my mistakes during compilation.
- First mistake : I used the protoc-3.5.0-win32 as a compiler.
- Second mistake : A. I located the Protobuf libraries into a wrong directory unlike the compilation guidline. All proto formated files to be compiled have designated path. I realized the fact through following error messege.

B. Also I figured out that the path to save compiled files(e.g., eval.py) has beed assigned.

[Here comes my solution]
- use the 3.4 version complier
- follow the path assinment as gitHub compilation guideline. Particaulary, do not chage the path in red box.

If you still failed to compile the the Protobuf libraries, you may download the compiled protos files below. protos.zip
Good luck!
This command solved my problem. However, you have to run this batch process in the research folder because some of the proto dependencies are hardcoded.
for /r %%v in (*.proto) do <YOUR_PROTO_PATH> object_detection\protos\%%~nv%%~xv --python_out=.
For windows, I had to compile all individual proto files in below folder Object_Detection\models\research\object_detection\protos. For some reason, *.proto is not picking all .proto files from this folder in this command.
Seems that the protoc version 3.5.1 cannot recognize the file extensions. However, version 3.4.0 is OK.
go to research> and just type protoc object_detection/protos/anchor_generator.proto --python_out=. and enter(before that you have to set system path to protoc.exe) Working Solution