由于所有计算都是在 session 下进行的,有没有办法将 Tensorflow 的预测导出到 Numpy/Pandas 数组或文件,即 CSV 或 TXT ?

谢谢 !
保罗

最佳答案

你想使用类似...

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=",")

关于Tensorflow : Export predictions to an array or a file,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/37888555/

10-12 04:58