当前位置: 代码迷 >> 综合 >> keras报错:ValueError: `steps_per_epoch=None` is only valid for a generator based on the `keras.utils.S
  详细解决方案

keras报错:ValueError: `steps_per_epoch=None` is only valid for a generator based on the `keras.utils.S

热度:44   发布时间:2024-01-09 04:49:14.0

keras报错:

ValueError: `steps_per_epoch=None` is only valid for a generator based on the `keras.utils.Sequence` class. Please specify `steps_per_epoch` or use the `keras.utils.Sequence` class.

解决方法:

在fit_generator中添加参数:

steps_per_epoch=x_train.shape[0],

 

  相关解决方案