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?