Tensorflow v1.3 の Dataset API で遊んでいます。それは素晴らしい。here で説明されているように、関数を使用してデータセットをマップすることができます。追加の引数を持つ関数を渡す方法を知りたいです。たとえば、次のようになりarg1
ます。
def _parse_function(example_proto, arg1):
features = {"image": tf.FixedLenFeature((), tf.string, default_value=""),
"label": tf.FixedLenFeature((), tf.int32, default_value=0)}
parsed_features = tf.parse_single_example(example_proto, features)
return parsed_features["image"], parsed_features["label"]
もちろん、
dataset = dataset.map(_parse_function)
を渡す方法がないため、機能しませんarg1
。