Wrap tensorflow into grpc error:keyError: “The name 'input:0' refers to a Tensor which does not exis

20 views
Skip to first unread message

Alexander Luya

unread,
May 23, 2018, 1:46:46 AM5/23/18
to grpc.io

I have a python class which contains tensorflow related stuff(session,model,logics ..),and I want to save an instance of this class as a field of another grpc-based class,and this grpc-based class implemented some grpc related logic,will listen on a port,and pass received request to saved tensorflow related instance to proces,whole logic like this:

TFRelated.py.......

class TFRelated:
   ....
   def init(self):
      #load model and another logic

   def process(self,req):
      ....
      tf.get_default_graph().get_tensor_by_name(..)
      ....

if __name__=='__main__':
    tfRelated=TFRelated()
    request=....
    #works fine
    tfRelated.process(request)

RPCBased.py.........

class RPCBased:
   def __init__(self):
       self.net=TFRelated()

   def rpcInterface(self,req):
      #the line below will give :keyError: "The name 'input:0' 
      #refers to a Tensor which does not exist..." 
       return self.net.process(req)

same model,same key,so not a key issue ,and the error only comes out under rpc context,so it may be rpc thread related issue,would you please help solve this problem?


Ken Payson

unread,
Jun 13, 2018, 5:57:44 PM6/13/18
to grpc.io
I don't see anything here indicating a gRPC related issue.  
Reply all
Reply to author
Forward
0 new messages