Jen*_*nny 4 python object-detection protoc tensorflow
我正在尝试使用以下命令编译 protoc 文件:
protoc/bin/protoc models/research/object_detection/protos/*.proto --python_out=.
Run Code Online (Sandbox Code Playgroud)
但我在 cmd 上得到这个输出
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.
models/research/object_detection/protos/anchor_generator.proto:5:1: Import "object_detection/protos/flexible_grid_anchor_generator.proto" was not found or had errors.
models/research/object_detection/protos/anchor_generator.proto:6:1: Import "object_detection/protos/grid_anchor_generator.proto" was not found or had errors.
models/research/object_detection/protos/anchor_generator.proto:7:1: Import "object_detection/protos/multiscale_anchor_generator.proto" was not found or had errors.
models/research/object_detection/protos/anchor_generator.proto:8:1: Import "object_detection/protos/ssd_anchor_generator.proto" was not found or had errors.
models/research/object_detection/protos/anchor_generator.proto:14:5: "GridAnchorGenerator" is not defined.
models/research/object_detection/protos/anchor_generator.proto:15:5: "SsdAnchorGenerator" is not defined.
models/research/object_detection/protos/anchor_generator.proto:16:5: "MultiscaleAnchorGenerator" is not defined.
models/research/object_detection/protos/anchor_generator.proto:17:5: "FlexibleGridAnchorGenerator" is not defined.
Run Code Online (Sandbox Code Playgroud)
那么可能是什么问题谢谢
您需要在正确的目录中运行 protobuf 编译器。在这种情况下,它将是models/research:
$ cd models/research
$ ../../protoc/bin/protoc object_detection/protos/*.proto --python_out=.
Run Code Online (Sandbox Code Playgroud)
protobuf 文件将被编译为 python。在目录中object_detection/protos/,您应该有以 protobuf 文件命名的 python 文件(即<name_protobuf>_pb2.py)。
这些 protobuf 文件中有相对导入,因此 protobuf 编译器在正确的目录中运行非常重要。您有一个提示,这可能是错误,因为File not Found错误消息列出了与当前目录不同的路径。
| 归档时间: |
|
| 查看次数: |
2384 次 |
| 最近记录: |