having problems with protoc
, the line doesn't work in windows.
I get this errors
:
using this line
protoc --proto_path=./object_detection/protos --python_out=c:\testmomo ./object_detection/protos/anchor_generator.proto
I get this error
object_detection/protos/grid_anchor_generator.proto: File not found.
object_detection/protos/ssd_anchor_generator.proto: File not found.
anchor_generator.proto: Import "object_detection/protos/grid_anchor_generator.proto" was not found or had errors.
anchor_generator.proto: Import "object_detection/protos/ssd_anchor_generator.proto" was not found or had errors.
anchor_generator.proto:12:5: "GridAnchorGenerator" is not defined.
anchor_generator.proto:13:5: "SsdAnchorGenerator" is not defined.
what is the problem??
I was trying different things, and figured out where was the problem.
Make sure you're doing it this way:
# From models/
protoc object_detection/protos/*.proto --python_out=.
whereas I was trying to do it like:
# from object_detection/
protoc protos/*.proto --python_out=.
that gives me errors as yours.
Check if you're in the right place (directory).
First make note protoc buffer is quite dumb and does not catches all the files properly, you have two options to manually compile all the 29 files or follow below steps.
Copy the protoc exe file to folder where all the proto files are ie "models-master\models-master\research\object_detection\protos"
Next open all the files in folder "models-master\research\object_detection\protos" using notepad++.
Press ctrl+f and remove "object_detection/protos/" in all the files ( if you are doing manually also remember the protoc starts in alphabetic order so start from file "anchor_generator.proto").
For example replace:-
import "object_detection/protos/grid_anchor_generator.proto";
import "object_detection/protos/ssd_anchor_generator.proto";
import "object_detection/protos/multiscale_anchor_generator.proto";
with this:-
import "grid_anchor_generator.proto";
import "ssd_anchor_generator.proto";
import "multiscale_anchor_generator.proto";
4.Now open Cmd in the same directory ie "\models master\research\object_detection\protos" type:- protoc *.proto --python_out=. notice you will get new .py file in the folder and no errors on execution of above file.
5.output:-
Note:- make sure you open all files and try using the output of step 4 to locate the missing files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With