New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
object_detection API protoc installation step fails #4002
Comments
I encountered the same issue and I think it's because of the update/latest commit. I bypassed the protoc error by checking out an older version (2018-04-13).
(How to checkout previous commit: https://stackoverflow.com/questions/3555107/git-clone-particular-version-of-remote-repository/18037563 ) |
Upgrade your protoc. |
@denglixi is correct. Update your protobuf compiler/runtime to 3.x.x |
@denglixi and @derekjchow, you were both correct. I removed the 2.6 protobuf-compiler and installed the 3.5.1 protobuf-compiler from github. What is frustrating is that the installation instructions in the object_detection api github still say to use the 2.6 version. I hope that this gets updated. Thank you! |
Will update the docs for next release |
related? |
I have protobuf 3.5.2 and still fail to compile. Why? object_detection/protos/ssd.proto:87:3: Expected "required", "optional", or "repeated". |
Make sure you grab the latest versioncurl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip Unzipunzip protoc-3.2.0-linux-x86_64.zip -d protoc3 Move protoc to /usr/local/bin/sudo mv protoc3/bin/* /usr/local/bin/ Move protoc3/include to /usr/local/include/sudo mv protoc3/include/* /usr/local/include/ Optional: change ownersudo chwon [user] /usr/local/bin/protoc |
@radzfoto: please show how did you install the 3.5.1 protobuf-compiler from github please! |
Hi @AliceDinh, here are some basic steps that may help to get you started: If you are using Ubuntu or similar, then use the archive manager to unzip everything in the file, or install unzip. Make sure that you put the protoc zip file in your target directory, then with unzip in a terminal window
You will now see a readme.txt file and two directories, bin and include. The protobuf compiler is a file in the bin directory called protoc. It doesn't hurt to make sure that protoc is executable, so do
Now you could add this directory to your PATH so you can execute from anywhere, for example:
If you want this to be permanent, add that line to your .bashrc file To use the protobuf compiler now, all you have to do is
I hope this helps. |
@radzfoto |
@Thaiph1308, if you download the protoc zip file, it should have everything inside. Please make sure you are downloading the correct file and unzipping it correctly. It is very important that you then execute this new version of protoc. You can make sure by putting the directory in the PATH environment variable. And make sure that you remove any other versions of protoc. |
@radzfoto |
Hi @huyutong, if you read my suggested procedure more carefully, I suggest that you do NOT use apt to install the protobuf compiler. Instead go directly to the download website here: |
@radzfoto |
@radzfoto |
I got the same problem, please give me a help. my protobuf is 3.5.2 version. edison@amax-server: |
I had the same problem, and attempted resolve things by updating to protobuf 3.5.2, but was unsuccessful. |
Following @sandunadhikari steps, I check my protoc version, it's still 2.6.1 (--version).
error message for this compilation disappear.
Update version of protoc to 3.2.0 works for me. |
try this pyscript... change the researchRoot for yourself. 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") |
I downloaded and installed protoc from source, and it worked for me:
Then, test the installation:
|
It is not working for me @bozcani
Can you please help? |
@upasana-mittal |
System information
Describe the problem
I followed object_detection installation instructions step by step. When I tried protoc command, .proto files could not be compiled to .py files.
I issued this command:
And obtained these errors:
Note that all the .proto files exist including ssd.proto.
Source code / logs
No custom source code. Just following object_detection API installation instructions
The text was updated successfully, but these errors were encountered: