我试图运行以下代码来训练模型:
history = model.fit(train_ds,
steps_per_epoch=train_len/20,
validation_data=val_ds,
validation_steps=val_len/20,
epochs=50,
verbose=1,
callbacks=[cp_callback]
)
但是得到错误:
TypeError: Cannot convert 0.8 to EagerTensor of dtype int64
我无法训练模型。
尝试使用int函数映射step_per_epoch和validation_steps:
int(steps_per_epoch=train_len/20)
int(validation_steps=val_len/20)