jeudi 28 février 2019

Testing the LSTM in Tensorflow

My network has Stacked LSTM->FC Layer. If i have to pass the input for testing, Can I just pass it to last FC layer, so that graph will connect fetching corresponding inputs for each layer or should I have to rebuild the graph?

I have constructed my code something like below:

with tf.Session() as sess:    

    saver = tf.train.import_meta_graph(r'my_model.meta')
    saver.restore(sess,tf.train.latest_checkpoint('./'))
    graph = tf.get_default_graph()
    w1 = graph.get_tensor_by_name("batch_x:0") 
    w2 = graph.get_tensor_by_name("batch_y:0") 
    operation = graph.get_tensor_by_name("fully_connected/Relu:0")
    output=sess.run(operation,{w1:input})

I'm expecting one hot vector and I am not getting, Please let me know how to do it. I have read many posts I am getting confused with every other post.

Aucun commentaire:

Enregistrer un commentaire