python - 在 Windows 上编译协议缓冲区 Tensorflow 对象检测 API
问题描述
我是 Windows 环境的新手,花了几个小时尝试使用对象检测教程安装 Tensorflow。我已经阅读了几十个线程并看过几个视频,但没有运气。
这就是我所在的位置:我安装了所有 Tensorflow 依赖项和 protoc(3.7 版)可执行文件,但是当我运行该行时object_detection/protos/*.proto --python_out=.
出现no such file or directory
错误。
这是我从命令行从模型目录运行的内容:
D:\training\Tensorflow\protoc\bin\protoc object_detection/protos/*.proto --python_out=.
我也尝试过D:\training\Tensorflow\protoc\bin\protoc research/object_detection/protos/*.proto --python_out=.
,因为从当前目录(模型)到 proto 文件的路径是research/object_detection/protos/
该线程建议逐个编译每个 .proto 文件,并在尝试编译第一个文件后使用D:\training\Tensorflow\protoc\bin\protoc research/object_detection/protos/anchor_generator.proto --python_out=.
我收到此错误:
object_detection/protos/grid_anchor_generator.proto: File not found.
object_detection/protos/ssd_anchor_generator.proto: File not found.
object_detection/protos/multiscale_anchor_generator.proto: File not found.
research/object_detection/protos/anchor_generator.proto: Import "object_detection/protos/grid_anchor_generator.proto" was not found or had errors.
research/object_detection/protos/anchor_generator.proto: Import "object_detection/protos/ssd_anchor_generator.proto" was not found or had errors.
research/object_detection/protos/anchor_generator.proto: Import "object_detection/protos/multiscale_anchor_generator.proto" was not found or had errors.
research/object_detection/protos/anchor_generator.proto:13:5: "GridAnchorGenerator" is not defined.
research/object_detection/protos/anchor_generator.proto:14:5: "SsdAnchorGenerator" is not defined.
research/object_detection/protos/anchor_generator.proto:15:5: "MultiscaleAnchorGenerator" is not defined.
那些其他 .proto 文件实际上在同一个目录中,所以我不确定为什么它没有找到它们。
我究竟做错了什么?
解决方案
research
您应该从目录运行命令。如此处所指定。
# From tensorflow/models/research/
D:\training\Tensorflow\protoc\bin\protoc object_detection/protos/*.proto --python_out=.
推荐阅读
- android - 将一个类传递给 Kotlin 函数以在适配器中创建 ViewHolder
- php - 如何从文本文件中读取列并插入数据库php
- ajax - 具有 multipart/form-data enctype 的表单选择元素
- c# - 如何在松弛的附件消息中添加提及?
- opencv - 找到最适合的图像
- c++ - 如何使用 unique_ptr 声明调用构造函数并处理程序终止信号
- post - PayPal 标准的 CORS 和 createPayment 错误
- visual-studio-2015 - Visual Studio 2015 调试不工作。错误:methodbase.cs 未找到
- yocto - 如何为单个配方使用不同的编译器?
- reactjs - 将数据从函数加载到状态