We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
please,, help me, how could I combine 3 numerical vectors with image features vectors using a generator, what is wrong in this code
def combined_generators(image_generator, x_data, y_data, z_data, batch_size): x_gen = cycle(batch(x_data, batch_size)) y_gen = cycle(batch(y_data, batch_size)) z_gen = cycle(batch(z_data, batch_size))
while True: nextImage = next(image_generator) nextx = next(x_gen) assert len(nextImage[0]) == len(nextx) nexty = next(y_gen) assert len(nextImage[0]) == len(nexty) nextz = next(z_gen) assert len(nextImage[0]) == len(nextz) yield [nextImage[0], nextx, nexty, nextz], nextImage[1]
def batch(iterable, n=1): l = len(iterable) for ndx in range(0, l, n): yield iterable[ndx:min(ndx + n, l)]
train_gen_wrapper = combined_generators(train_batches, df['x'], df['y'], df['z'], 16) val_gen_wrapper = combined_generators(valid_batches, dft['x'], dft['y'], dft['z'], 16)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
please,, help me, how could I combine 3 numerical vectors with image features vectors using a generator, what is wrong in this code
def combined_generators(image_generator, x_data, y_data, z_data, batch_size):
x_gen = cycle(batch(x_data, batch_size))
y_gen = cycle(batch(y_data, batch_size))
z_gen = cycle(batch(z_data, batch_size))
def batch(iterable, n=1):
l = len(iterable)
for ndx in range(0, l, n):
yield iterable[ndx:min(ndx + n, l)]
train_gen_wrapper = combined_generators(train_batches, df['x'], df['y'], df['z'], 16)
val_gen_wrapper = combined_generators(valid_batches, dft['x'], dft['y'], dft['z'], 16)
The text was updated successfully, but these errors were encountered: