Skip to content
New issue

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

StopIteration: generator_output = next(output_generator) #8

Open
asjad18 opened this issue Nov 29, 2019 · 1 comment
Open

StopIteration: generator_output = next(output_generator) #8

asjad18 opened this issue Nov 29, 2019 · 1 comment

Comments

@asjad18
Copy link

asjad18 commented Nov 29, 2019

Hi, I have followed this tutorial step by step for skin segmentation task, but when I execute model.train() , I get the error mentioned in title.
I am using tensorflow 1.15 and keras 2.0.8

@mohsinht
Copy link

Same here.

CODE:

start_train = time.time()
model.train(train_data, test_data, 
            learning_rate=config.LEARNING_RATE, 
            epochs=5, 
            layers='heads')
end_train = time.time()
minutes = round((end_train - start_train) / 60, 2)
print(f'Training took {minutes} minutes')

ERROR:

StopIteration                             Traceback (most recent call last)
<ipython-input-23-1abede8f6975> in <module>
      3             learning_rate=config.LEARNING_RATE,
      4             epochs=5,
----> 5             layers='heads')
      6 end_train = time.time()
      7 minutes = round((end_train - start_train) / 60, 2)

/kaggle/working/Mask_RCNN/mrcnn/model.py in train(self, train_dataset, val_dataset, learning_rate, epochs, layers, augmentation, custom_callbacks, no_augmentation_sources)
   2372             max_queue_size=100,
   2373             workers=workers,
-> 2374             use_multiprocessing=True,
   2375         )
   2376         self.epoch = max(self.epoch, epochs)

/opt/conda/lib/python3.6/site-packages/keras/legacy/interfaces.py in wrapper(*args, **kwargs)
     85                 warnings.warn('Update your `' + object_name +
     86                               '` call to the Keras 2 API: ' + signature, stacklevel=2)
---> 87             return func(*args, **kwargs)
     88         wrapper._original_function = func
     89         return wrapper

/opt/conda/lib/python3.6/site-packages/keras/engine/training.py in fit_generator(self, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch)
   2009                 batch_index = 0
   2010                 while steps_done < steps_per_epoch:
-> 2011                     generator_output = next(output_generator)
   2012 
   2013                     if not hasattr(generator_output, '__len__'):

StopIteration: ```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants