oracle / graphpipe-tf-py

GraphPipe helpers for TensorFlow
https://oracle.github.io/graphpipe
Other
23 stars 10 forks source link

how to pass x when model have multi input_tensor? #3

Closed jiahengqi closed 6 years ago

jiahengqi commented 6 years ago

I tried this

def get_model(): x1=Input((1,),name='x1') x2=Input((1,),name='x2') x=Add()([x1,x2]) y=Dense(1)(x) model=Model([x1,x2],y) model.compile('adam','mse') return model

from graphpipe import remote x1=np.random.rand(10) x2=np.random.rand(10) y1=model.predict([x1,x2]) y2 = remote.execute("http://127.0.0.1:9000", [x1,x2],['x1','x2'])

and it raise ValueError: Tensor Tensor("dense_1/BiasAdd:0", shape=(?, 1), dtype=float32) is not an element of this graph.

jiahengqi commented 6 years ago

sorry the error is 'list' object has no attribute 'nbytes'

jiahengqi commented 6 years ago

done use remote.execute_multi("http://127.0.0.1:9000", [x1.reshape(-1,1),x2.reshape(-1,1)],["",""],[""]) and change name = ops[0].name to name = ops[i].name in model_server.py, line 84