How do you send arguments to a generator function using tf.data.Dataset.from_generator()?
问题 I would like to create a number of tf.data.Dataset using the from_generator() function. I would like to send an argument to the generator function ( raw_data_gen ). The idea is that the generator function will yield different data depending on the argument sent. In this way I would like raw_data_gen to be able to provide either training, validation or test data. training_dataset = tf.data.Dataset.from_generator(raw_data_gen, (tf.float32, tf.uint8), ([None, 1], [None]), args=([1])) validation