Note that fit_generator() is deprecated. You can use fit() directly with Python generators.
An example for a batch size of 1
history = model.fit(generate_data(), steps_per_epoch=len(x_train), epochs=100,
callbacks = [callback],class_weight={0:4, 1:1}, validation_data=generate_val(),
validation_steps=len(x_test))
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…