ニューラルネットワークのテンソルフローでモデルを作成しました。 モデルを保存して別のpythonファイルに復元しました。テンソルフローと予測における復元モデル
コードは以下の通りです:
def restoreModel():
prediction = neuralNetworkModel(x)
tf_p = tensorFlow.nn.softmax(prediction)
temp = np.array([2,1,541,161124,3,3])
temp = np.vstack(temp)
with tensorFlow.Session() as sess:
new_saver = tensorFlow.train.import_meta_graph('model.ckpt.meta')
new_saver.restore(sess, tensorFlow.train.latest_checkpoint('./'))
all_vars = tensorFlow.trainable_variables()
tensorFlow.initialize_all_variables().run()
sess.run(tensorFlow.initialize_all_variables())
predict = sess.run([tf_p], feed_dict={
tensorFlow.transpose(x): temp,
y : ***
})
私が予測したいものにおける "TEMP" 変数! Xはベクトルの形であり、私はそれを形に合わせて "入れ替える"。 私はfeed_dict
変数に書く必要があることを理解していません。