问题描述
定义每个时间段的样本= 233,nb_val_samples = 62且时间段= 4,然后出现错误
res <- unique(l)
names(res) <- unique(names(l))
解决方法
检查documentations中是否有fit_generator
的预期参数。对于您当前的情况,以下方法应该起作用:
history_object = model.fit_generator(train_generator,steps_per_epoch=samples_per_epoch,validation_data=validation_generator,validation_steps=nb_val_samples,epochs=nb_epoch,verbose=1,callbacks=callbacks_list)
,
在我的情况下,将TensorFlow设置为1.14.0并将Keras设置为2.3.1,可以很好地解决上述问题,因为在最新的模型场景中不推荐使用fit_generator()。
安装这些版本,对于上面的示例来说可以正常工作。
pip install keras == 2.3.1 pip install tensorflow == 1.14.0