as in keras documentation in the (image, mask) data generator, I created data generator to have (input, output) tuple images.
When running locally on my laptop (with tensorflow 1.13.1), it runs with no issues, but when running on a server (with tensorflow-gpu 1.13.1), I get the error:
AttributeError: 'zip' object has no attribute 'shape'
so as in the example, after creating two generators with flow_from_directory:
from tensorflow import keras
...
input_gen = input_datagen.flow_from_directory(
directory=os.path.join(path_in, dirname),
class_mode=None,
color_mode=color_mode,
batch_size=batch_size,
target_size=(img_size, img_size),
seed=seed_in)
I combined them as in the keras documentation:
train_generator = zip(input_gen, output_gen)
and feed them to the fit_generator(...)
currently solved it using a function to generate the new combined generator as suggested here:
def combine_generator(gen1, gen2):
while True:
yield(gen1.next(), gen2.next())
though I would still like to understand why the tensorflow cpu version doesn't get this error, and why the zip isn't supported in the gpu version...