I want to create one CNN model including all nSeizures models instead of creating model for each seizure file, but i got this error < AttributeError: 'NoneType' object has no attribute 'fit_generator'>.
for i in range(0, nSeizure):
print(nSeizure)
print('SEIZURE OUT: '+str(i+1))
print('Training start')
## create model
model = createModel()
filesPath=getFilesPathWithoutSeizure(i, indexPat)
## create one model including all nSeizures models
for model in range(0, nSeizure):
mylist.append(model)
data=mylist.append(model)
history=data.fit_generator(generate_arrays_for_training(indexPat, filesPath, end=75),
validation_data=generate_arrays_for_training(indexPat, filesPath,
start=75),
#steps_per_epoch=10000, epochs=10)
steps_per_epoch=int((len(filesPath)-int(len(filesPath)/100*25))),
validation_steps=int((len(filesPath)-int(len(filesPath)/100*75))),
verbose=2,
epochs=300, max_queue_size=2, shuffle=True, callbacks=[callback])
mylist.append(model)
returns None.
when you call data.fit_generator
it effectively means None.fit_generator
.
Consider rewriting the code.