protoc object_detection/protos/*.proto: No such fi

2020-02-08 06:07发布

I am following the example found here. But whenever I enter the command "C:/Program Files/protoc/bin/protoc" object_detection/protos/.proto --python_out=. I get an error that says object_detection/protos/.proto: No such file or directory. I can't create a directory called *.proto. So I'm missing some fundamental information on how to do this. Since I can't find anyone else complaining about this issue it must be pretty simple. I am using a windows OS.

16条回答
迷人小祖宗
2楼-- · 2020-02-08 06:35

Hi everyone this was how I was able to solve this error while learning about object detection using tensorflow:

STEPS:

1- To download the Google Protobuf for Windows 10 64 bit system, head onto this link. https://github.com/protocolbuffers/protobuf/releases/tag/v3.4.0 and install “protoc-3.4.0-win32.zip”.(Advice-Don't install protoc-3.6.0)

2- Download models file from this link. https://github.com/tensorflow/models

3.Now you need to execute the protobuf compile within the command prompt with help of research directory:

4-First get inside research directory: cd C:\Users\Ankit\tensorflow\models\research and press Enter//just an example

5-Then do this step immediate after above step:

"C:\Users\Ankit\Desktop\Tensorflow\protbuf\bin\protoc.exe" object_detection/protos/*.proto --python_out=. and press Enter(There is space between object and " sign and this is written in one line)

6-Note: Go to the object_detection/protos folder, and if there are .py files, you’ve successfully completed the compilation of your .proto files

THANK YOU

查看更多
干净又极端
3楼-- · 2020-02-08 06:35

Solved for Windows, be in 'research' and have the 'protoc' in path, then this will work:

for /f %i in ('dir /b object_detection\protos\*.proto') do protoc object_detection\protos\%i --python_out=.

Good Luck !

查看更多
在下西门庆
4楼-- · 2020-02-08 06:37

I have same problem on ubuntu 16.04. Change directory to research and now this file missing problem solved.

查看更多
看我几分像从前
5楼-- · 2020-02-08 06:42

A little python code that may help you compile protoc faster

import os

#folder where protos are located
os.chdir('C:\\Users\\ ~ \\models-master\\research\\object_detection\\protos')
#list protos
fs=os.listdir()

#back to where your protoc.exe is located
os.chdir('C:\\Users\\ ~ \\models-master\\research')

for f in fs:
if f.find(".proto")>-1:
    print(f)
    s='protoc object_detection/protos/'+f+' --python_out=.'
    print(s)
    os.system(s)
查看更多
Lonely孤独者°
6楼-- · 2020-02-08 06:43

If it turns out you you're missing the whole models/research/object_detection/protos sub-tree like me, you can download it separately from https://github.com/tensorflow/models. Not having these files will give the same error, i.e. No such file or directory.

查看更多
别忘想泡老子
7楼-- · 2020-02-08 06:46

sometimes windows Cmd doesn't accept wildcard '*'. that's why it shows error. you can use loop to solve this problam. to create Loop in Cmd checkout this link. https://ss64.com/nt/for.html ref: protoc cannot find files in windows 7

查看更多
登录 后发表回答