models icon indicating copy to clipboard operation
models copied to clipboard

object_detection/protos/*.proto: No such file or directory

Open Hemanth-Mydugolam opened this issue 9 years ago • 61 comments

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.

Hemanth-Mydugolam avatar Nov 30 '17 06:11 Hemanth-Mydugolam

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.

ybsave avatar Nov 30 '17 18:11 ybsave

@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

johnyboyoh avatar Dec 01 '17 15:12 johnyboyoh

@Hemanth2396 , do these suggestions resolve your issues? either writing a batch file, using 3.4 instead of 3.5, and the info on #1591?

aselle avatar Dec 01 '17 19:12 aselle

I have try 3.4 but it also doesn't work. Has anyone solved the problem?

ChenyuWang123 avatar Dec 05 '17 20:12 ChenyuWang123

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.

ChenyuWang123 avatar Dec 05 '17 21:12 ChenyuWang123

i have the same problem . but after i install protobuff 3.4 , the error message become :Invalid argument . can anyone give a suggestion?

Rulen9987 avatar Dec 06 '17 09:12 Rulen9987

@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

woodsja avatar Dec 12 '17 18:12 woodsja

Same issue on my windows10 and anaconda3, i had install protoc3.4 2

Aisuko avatar Dec 14 '17 07:12 Aisuko

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=.

lg0killer avatar Dec 15 '17 11:12 lg0killer

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=.

Reference linking

Aisuko avatar Dec 16 '17 06:12 Aisuko

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.

mcorange1997 avatar Dec 16 '17 09:12 mcorange1997

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=.

prathaprpm avatar Dec 19 '17 13:12 prathaprpm

I used following powershell command on windows: Get-ChildItem object_detection/protos/*.proto | Resolve-Path -Relative | %{ .\protoc $_ --python_out=. }

obabac avatar Dec 30 '17 20:12 obabac

Thanks @obabac. That did the trick.

saagr avatar Jan 09 '18 12:01 saagr

I installed v3.4.0 and it solved the issue

singhgurjyot avatar Jan 18 '18 10:01 singhgurjyot

After 60 hour's trials and errors, I finally succeeded in compiling the Protobuf libraries.
I like to share my mistakes during compilation.

  1. First mistake : I used the protoc-3.5.0-win32 as a compiler.
  2. 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.

figure1

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

[Here comes my solution]

  1. use the 3.4 version complier
  2. follow the path assinment as gitHub compilation guideline. Particaulary, do not chage the path in red box. ans1

If you still failed to compile the the Protobuf libraries, you may download the compiled protos files below. protos.zip

Good luck!

songam128 avatar Feb 18 '18 00:02 songam128

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=.

maedhril avatar Feb 24 '18 12:02 maedhril

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.

asitkdash avatar Apr 02 '18 10:04 asitkdash

Seems that the protoc version 3.5.1 cannot recognize the file extensions. However, version 3.4.0 is OK.

hustc12 avatar Apr 03 '18 22:04 hustc12

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

HansaTharuka avatar Apr 19 '18 03:04 HansaTharuka