I have installed TensorFlow successfully, and when I try to install Object-Detection-API in issuing below command I got error:
Command:
# From tensorflow/models/research/
protoc object_detection/protos/*.proto --python_out=.
Error:
ction/protos/*.proto --python_out=.
object_detection/protos/ssd.proto:87:3: Expected "required", "optional", or "repeated".
object_detection/protos/ssd.proto:87:12: Expected field name.
object_detection/protos/model.proto: Import "object_detection/protos/ssd.proto" was not found or had errors.
object_detection/protos/model.proto:12:5: "Ssd" is not defined.
I have search on the internet, but did not find any solution, so what should I do?
I have the same problem with you. have you find any way to solve it? need your help,please~ @Bahramudin
you should install protobuf 3.x+
refer to https://gist.github.com/sofyanhadia/37787e5ed098c97919b8c593f0ec44d8
@chelixuan I have just asked this question, till now, I did not find any solution for this. But it maybe because of protobuf version which needs to install 3+ version.
@chelixuan The problem was solved by installing the newer version of protobuf.
As the problem is solved, I will close the issue.
@Bahramudin I been crazy about it .(I even want to modify the model.proto code to mute the compile of ssd.proto, but I dare not) And I updated the protobuf's version to the latest 3.5.2.post1, it still did NOT work....so,How is this issue now? you solve it ?
@NNsauce I have solved the problem by installing the newer version of the protobuf.
You can also solve the issue by removing the line 87 of ssd.proto. Which will also solve the issue.
Thanks
this worked for me.
i installed protobuf 3.x version using
https://gist.github.com/sofyanhadia/37787e5ed098c97919b8c593f0ec44d8
later i ran
/usr/local/bin/protoc object_detection/protos/*.proto --python_out=.
try this pyscript... change the researchRoot for yourself.
It works perfectly for me ( I use protobuf 3.6 ).
you can execute the script at any folder.
import sys
import os
import subprocess
researchRoot = os.path.normpath( "D:/Program Files (x86)/Microsoft Visual Studio/Shared/Python36_64/Lib/site-packages/tensorflow/models/research/" )
protoRoots_ = os.listdir(researchRoot)
protoRoots = []
for protoRoot_ in protoRoots_:
if ( protoRoot_ in protoRoots ):
continue
for root, dirs, files in os.walk(os.path.join(researchRoot, protoRoot_)):
if ( protoRoot_ in protoRoots ):
break
for name in files:
if ( os.path.splitext(name)[1] == ".proto" ):
protoRoots.append( protoRoot_ )
break
for protoRoot in protoRoots:
for root, dirs, files in os.walk(os.path.join(researchRoot, protoRoot)):
for name in files:
if ( os.path.splitext(name)[1] == ".proto" ):
cmdStr = \
"protoc " + name + \
" --proto_path=\"" + root + "\" " + \
" --proto_path=\"" + os.path.join(researchRoot, protoRoot) + "\" " + \
" --proto_path=\"" + researchRoot + "\" " + \
"--python_out=."
print(cmdStr)
with subprocess.Popen(cmdStr, stdout=subprocess.PIPE, shell=True, cwd=researchRoot) as proc:
stdout, stderr = proc.communicate()
cmdExit = proc.returncode
if ( cmdExit != 0 ):
print ("cmdExit == " + str(cmdExit) )
print ("stdout")
print (stdout)
print ("stderr")
print (stderr)
else:
print ("cmdExit == 0")
Most helpful comment
you should install protobuf 3.x+
refer to https://gist.github.com/sofyanhadia/37787e5ed098c97919b8c593f0ec44d8