Due to the limitation of RAM memory, I followed these instructions and built a generator that draw small batch and pass them in the fit_generator of Keras. But Keras can\'t
I received the same error saying my generator class which inherited from keras.utils.Sequence object is not an iterator.
Neither adding the __next__ method nor changing between keras.utils.Sequence and tf.keras.utils.Sequence helped.
For me, my __getitem__ class was not correctly implemented. While trying to use all the data, the last batch was a partial batch which I was not handling correctly. When I handled this correctly, the object is not an iterator error went away. Thus, I suggest you carefully inspect your __getitem__() implementation and consider it for all index values passed to __getitem__().