gpt4 book ai didi

python - 类型错误 : fit_generator() got an unexpected keyword argument 'samples_per_epoch'

转载 作者:行者123 更新时间:2023-12-04 00:54:51 24 4
gpt4 key购买 nike

定义每个时期的样本 = 233 和 nb_val_samples = 62 和时期 = 4 然后我得到错误

Type-error: fit_generator() got an unexpected keyword argument 'samples_per_epoch'


是什么导致了这个错误以及如何解决它?
history_object = model.fit_generator(train_generator, 
samples_per_epoch=samples_per_epoch,
validation_data=validation_generator,
nb_val_samples=nb_val_samples,
nb_epoch=nb_epoch, verbose=1,
callbacks=callbacks_list)

```


最佳答案

检查 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)

关于python - 类型错误 : fit_generator() got an unexpected keyword argument 'samples_per_epoch' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63359321/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com