Models: Import "object_detection/protos/ssd.proto" was not found or had errors.

Created on 14 Jun 2018  路  5Comments  路  Source: tensorflow/models

I got this problem when i try to make installation. please help me.

edison@amax-server:~/google_TF_object_detection/models/research$ protoc object_detection/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.

research awaiting model gardener awaiting response

Most helpful comment

Can confirm @edisonchensy issue on Ubuntu 16.04, using the Protobuf compiler (v2.6.1) from the standard repositories.
Switching to the latest release (v.3.6.0) from Github resolves it, at least on Ubuntu 16.04, as you @derekjchow already expected.

All 5 comments

here is my protobuf info:

/home/edison/anaconda3/lib/python3.6/site-packages/google/protobuf/*
/home/edison/anaconda3/lib/python3.6/site-packages/protobuf-3.6.0-py3.6-nspkg.pth
/home/edison/anaconda3/lib/python3.6/site-packages/protobuf-3.6.0.dist-info/*

Could you report the output of protoc --version?

My suspicion is your version of the protobuf compiler (not runtime libraries) is dated.

Can confirm @edisonchensy issue on Ubuntu 16.04, using the Protobuf compiler (v2.6.1) from the standard repositories.
Switching to the latest release (v.3.6.0) from Github resolves it, at least on Ubuntu 16.04, as you @derekjchow already expected.

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")

Hi There,
We are checking to see if you still need help on this, as this seems to be considerably old issue. Please update this issue with the latest information, code snippet to reproduce your issue and error you are seeing.
If we don't hear from you in the next 7 days, this issue will be closed automatically. If you don't need help on this issue any more, please consider closing this.

Was this page helpful?
0 / 5 - 0 ratings