Generator “TypeError: 'generator' object is not an iterator”

前端 未结 3 580
-上瘾入骨i
-上瘾入骨i 2020-12-18 11:03

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

3条回答
  •  伪装坚强ぢ
    2020-12-18 11:46

    I have figured it out. My model was from keras.models import Model However the generator was extended from class DataGenerator(tf.keras.utils.Sequence): That causes the bug! So, just change the Generator class DataGenerator(tf.keras.utils.Sequence) to class DataGenerator(keras.utils.Sequence):

提交回复
热议问题