由于所有计算都是在会话下进行的,有没有办法将Tensorflow的预测导出到Numpy / Pandas数组或文件,即CSV或TXT?
谢谢! 保罗
答案 0 :(得分:2)
你想要使用类似......
的东西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=",")