当前位置: 代码迷 >> 综合 >> linux+win:proto编译问题方法总结 “object_detection/protos/*.proto: No such file or directory”
  详细解决方案

linux+win:proto编译问题方法总结 “object_detection/protos/*.proto: No such file or directory”

热度:54   发布时间:2023-10-28 12:14:19.0

一般情况下在research文件夹下面运行:

protoc object_detection/protos/*.proto --python_out=.

——————————结果出错了。所以,看下面————————

win:

shift+右键 在Windows powershell中使用以下命令:

Get-ChildItem object_detection/protos/*.proto |Resolve-Path -Relative | %{
    protoc $_ --python_out=.}

如果没有 Windows powershell,自己百度,打开 Windows powershell 窗口,cmd下 上面命令不可用

win+linux 都可试一下

protoc .\object_detection\protos\string_int_label_map.proto --python_out=.

终极

该错误无非是不能批量编译,只能一个一个的编译,所以
新建批处理文件 xxx.bat,放在research下,双击运行

protoc object_detection\protos\anchor_generator.proto --python_out=.
protoc object_detection\protos\argmax_matcher.proto --python_out=.
protoc object_detection\protos\bipartite_matcher.proto --python_out=.
protoc object_detection\protos\box_coder.proto --python_out=.
protoc object_detection\protos\box_predictor.proto --python_out=.
protoc object_detection\protos\eval.proto --python_out=.
protoc object_detection\protos\faster_rcnn.proto --python_out=.
protoc object_detection\protos\faster_rcnn_box_coder.proto --python_out=.
protoc object_detection\protos\graph_rewriter.proto --python_out=.
protoc object_detection\protos\grid_anchor_generator.proto --python_out=.
protoc object_detection\protos\hyperparams.proto --python_out=.
protoc object_detection\protos\image_resizer.proto --python_out=.
protoc object_detection\protos\input_reader.proto --python_out=.
protoc object_detection\protos\keypoint_box_coder.proto --python_out=.
protoc object_detection\protos\losses.proto --python_out=.
protoc object_detection\protos\matcher.proto --python_out=.
protoc object_detection\protos\mean_stddev_box_coder.proto --python_out=.
protoc object_detection\protos\model.proto --python_out=.
protoc object_detection\protos\multiscale_anchor_generator.proto --python_out=.
protoc object_detection\protos\optimizer.proto --python_out=.
protoc object_detection\protos\pipeline.proto --python_out=.
protoc object_detection\protos\post_processing.proto --python_out=.
protoc object_detection\protos\preprocessor.proto --python_out=.
protoc object_detection\protos\region_similarity_calculator.proto --python_out=.
protoc object_detection\protos\square_box_coder.proto --python_out=.
protoc object_detection\protos\ssd.proto --python_out=.
protoc object_detection\protos\ssd_anchor_generator.proto --python_out=.
protoc object_detection\protos\string_int_label_map.proto --python_out=.
protoc object_detection\protos\train.proto --python_out=.
  相关解决方案