2016-09-18 13 views
0

次のように私は、カスタムの入力機能を持っている:なぜtf.train.batchは機能のバッチを1つだけ返しますか?

def my_input_fn(): 
    # parse a file and create a dictionary of features 
    return features 

この機能はinput_fnのparamとしてtf.contrib.learn.Estimator.predict関数に渡されます。私は異なるバッチで自分のデータを渡したい。検索後、それはtf.train.batchの責任と思われます。だから、次のように私の機能を編集:

def my_input_fn(): 
    # parse a file and create a dictionary of features 
    return tf.learn.batch(tensors=features, batch_size=100, enqueue_many=True) 

問題がpredict(input_fn=my_input_fn)を呼び出すとバッチのみで100例についての推定結果を返すということです。すべてのデータをバッチで返すようにするには、どのようにしてmy_input_fn関数を設計できますか?将来の読者のために

答えて

0

  • 問題が解決as_iterable=Trueを設定します。
関連する問題