'protoc doesn't see files? (I'm doing something wrong)
I'm trying to run:
protoc *.proto -python_out=.
in the protoc directory inside of tensorflow > models > research > object_detection > protos, and it returns
object_detection/protos/flexible_grid_anchor_generator.proto: File not found.
object_detection/protos/grid_anchor_generator.proto: File not found.
object_detection/protos/multiscale_anchor_generator.proto: File not found.
object_detection/protos/ssd_anchor_generator.proto: File not found.
anchor_generator.proto: Import "object_detection/protos/flexible_grid_anchor_generator.proto" was not found or had errors.
anchor_generator.proto: Import "object_detection/protos/grid_anchor_generator.proto" was not found or had errors.
anchor_generator.proto: Import "object_detection/protos/multiscale_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:14:5: "GridAnchorGenerator" is not defined.
anchor_generator.proto:15:5: "SsdAnchorGenerator" is not defined.
anchor_generator.proto:16:5: "MultiscaleAnchorGenerator" is not defined.
anchor_generator.proto:17:5: "FlexibleGridAnchorGenerator" is not defined.
But it seems to me that those files are definitely there?

Thanks for your patience and time.
edit: I also tried using absolute paths
protoc /home/usr/.virtualenvs/capstone/lib/python3.8/site-packages/tensorflow/models/research/object_detection/protos/*.proto --python_out=/home/usr/.virtualenvs/capstone/lib/python3.8/site-packages/tensorflow/models/research/object_detection/protos
I receive the same error
Solution 1:[1]
Inside the file faster_rcnn.proto you can see its import path is object_detection/protos/anchor_generator.proto
syntax = "proto2";
package object_detection.protos;
import "object_detection/protos/anchor_generator.proto";
import "object_detection/protos/box_predictor.proto";
It is importing and expecting the files at this path. You can see the file doesn't mean the program can also see those. Fix for it is very easy, change your directory to models/research/.
Then Run protoc object_detection/protos/*.proto -python_out=. It will compile protos without any error, and you will see .py versions in the folder.
Hope it helped.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Vinay Verma |
