加载Keras模型的权重时出错

时间:2019-03-25 15:48:31

标签: python tensorflow keras

我使用Keras训练了一个模型,并在使用回调的训练过程中将权重保存在* .hdf5文件中:

callbacks_list = [tf.keras.callbacks.ModelCheckpoint(filepath_checkpoint, monitor='val_loss', verbose=1, save_best_only=True, mode='min')]

当我尝试使用model.load_weights(filepath_checkpoint)将权重重新加载到模型中时,出现以下错误:

2019-03-25 16:34:20.291041: W tensorflow/core/util/tensor_slice_reader.cc:95] Could not open Yolo/weights-best-tiny-test.hdf5: Data loss: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?

可以帮我解决这个问题吗? 谢谢

0 个答案:

没有答案