报错原因为:AttributeError: KerasTPUModel’ object has no attribute _ckpt_saved_epoch
callback = [
ModelCheckpoint(
# ‘./ckpt/fine_tuning/weights.{epoch:02d}-{val_acc:.2f}.hdf5’,
‘./ckpt/fine_tuning/weights.{epoch:02d}-{acc:.2f}.hdf5’,
monitor=‘val_acc’,
save_best_only=True,
save_weights_only=True,
mode=‘auto’,
period=1),
TensorBoard(log_dir="./graph")
]
ModelCheckpoint:这个导入模块错误:
错误导入:使用keras.model导入的时候导入:# from tensorflow.python.keras.callbacks import ModelCheckpoint, TensorBoard
需要使用:
from keras.callbacks import ModelCheckpoint,TensorBoard
一般情况下是。keras模块导入的时候使用同一类型的模块设置。