Keras: Multiple Inputs for fit_generator using flow_from_directory

前端 未结 1 761
轻奢々
轻奢々 2021-01-01 05:57

Is it possible to have two flow_from_directory in a fit_generator?

For example

train_generator_1 = train_datagen.flow_from_directory(
    train_data_         


        
相关标签:
1条回答
  • 2021-01-01 06:26

    You can try making a generator that contains both:

    In python 3:

    def doubleGenerator(generator1,generator2):
    
        while True:
            for (x1,y1),(x2,y2) in zip(generator1,generator2):
                yield ([x1,x2],y1)
    
    0 讨论(0)
提交回复
热议问题