Taimur Islam
Taimur Islam

Reputation: 990

Predict from Previously trained Model Tensorflow

I have trained a Regression Model using tensorflow. The model saved file like

  1. model.ckpt-4000.meta
  2. model.ckpt-4000.index
  3. model.ckpt-4000.data-00001-of-00002

Now if i want to use those file to predict output values from new data set (test data), how can i do that?

Upvotes: 0

Views: 70

Answers (1)

Deven
Deven

Reputation: 741

sess=tf.Session()

#First load meta graph and restore weights

saver = tf.train.import_meta_graph('model.ckpt-4000.meta')
saver.restore(sess,tf.train.latest_checkpoint('./'))

# create feed-dict to feed new data and specify the y variable to be evaluated
sess.run(y,feed_dict)

Upvotes: 1

Related Questions