How do you send arguments to a generator function using tf.data.Dataset.from_generator()?

后端 未结 2 1895
忘掉有多难
忘掉有多难 2021-02-20 04:40

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 (

2条回答
  •  南方客
    南方客 (楼主)
    2021-02-20 05:26

    For Tensorflow 2.4:

    training_dataset = tf.data.Dataset.from_generator(
         raw_data_gen, 
         args=(1), 
         output_types=(tf.float32, tf.uint8), 
         output_shapes=([None, 1], [None]))
    

提交回复
热议问题