如何使用keras创建CNN模型?

时间:2020-02-15 20:09:23

标签: machine-learning keras deep-learning conv-neural-network model-fitting

我想创建一个包含所有nSeizures模型的CNN模型,而不是为每个缉获文件创建模型,但是我收到此错误

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])

1 个答案:

答案 0 :(得分:0)

mylist.append(model)返回无。 当您呼叫data.fit_generator时,它实际上是指None.fit_generator。 考虑重写代码。