Reputation: 443
As all the computations are made under a session, is there a way to export the predictions of Tensorflow to a Numpy/Pandas array or a file, i.e. CSV or TXT ?
Thanks ! Paul
Upvotes: 4
Views: 5529
Reputation: 2075
You want to use something like...
im = Image.open('/home/kendall/Desktop/HA900_frames/frame0635.tif')
batch_x = np.array(im)
batch_x = batch_x.reshape((1, n_steps, n_input))
batch_x = batch_x.astype(float)
prediction = sess.run(pred, feed_dict={x: batch_x})
prediction = np.asarray(prediction)
prediction = np.reshape(prediction, (200,200))
np.savetxt("prediction.csv", prediction, delimiter=",")
Upvotes: 2