Kaggle-Carvana-Image-Masking-Challenge icon indicating copy to clipboard operation
Kaggle-Carvana-Image-Masking-Challenge copied to clipboard

Getting StopIteration error

Open shivam-chandhok opened this issue 7 years ago • 7 comments

Hey,I am getting a StopIteration error when valid_generator( ) is called .The error is given below

StopIteration Traceback (most recent call last) in () 6 #callbacks=callbacks, 7 validation_data=valid_generator(), ----> 8 validation_steps=np.ceil(float(len(ids_valid_split)) / float(batch_size)))

/Users/shivamchandhok/anaconda2/lib/python2.7/site-packages/keras/legacy/interfaces.pyc 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

/Users/shivamchandhok/anaconda2/lib/python2.7/site-packages/keras/engine/training.pyc in fit_generator(self, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, class_weight, max_queue_size, workers, use_multiprocessing, initial_epoch) 1807 batch_index = 0 1808 while steps_done < steps_per_epoch: -> 1809 generator_output = next(output_generator) 1810 1811 if not hasattr(generator_output, 'len'):

StopIteration:

shivam-chandhok avatar Aug 08 '17 13:08 shivam-chandhok

Can't reproduce this issue. Is your Keras version up-to-date? If you remove validation from fit_generator do you still get the error?

petrosgk avatar Aug 09 '17 09:08 petrosgk

yes the error is still there. there is some issue with the line generator_output=next(output_generator)

shivam-chandhok avatar Aug 12 '17 14:08 shivam-chandhok

Have you tried on another Python environment?

petrosgk avatar Aug 14 '17 06:08 petrosgk

My problem was that the train_mask data is the gif format. Converting them to png may solve this.

ykataoka avatar Aug 15 '17 01:08 ykataoka

OpenCV doesn't read GIF. You can easily switch to sklearn.io.imread

amitani avatar Aug 15 '17 02:08 amitani

Getting the same error...please help I have converted the GIF files to png format.. Still he issue exists

ChandanVerma avatar Sep 05 '17 08:09 ChandanVerma

@ykataoka Converting them to png didn't solve this issue. Any other solutions?

bondeanikets avatar Nov 18 '17 19:11 bondeanikets