如何根据加载的权重创建损失图? (model.load_weights)如何将model.load_weights添加到历史记录中?

How to create a loss plot from loaded weights? (model.load_weights) How to add model.load_weights to history?

我想制造损失。 (情节)我使用 Mask-RCNN。我从我的模型中加载了一个权重。但我无法创建损失函数。我得到错误:'Model' object has no attribute 'history'

model = modellib.MaskRCNN(mode="training",
                          config=config,
                          model_dir=ROOT_DIR)

model.load_weights('/my/path/to/mask_rcnn_0007.h5', by_name=True)
model.load_weights(''/my/path/to/mask_rcnn_0008.h5'', by_name=True)
model.load_weights(''/my/path/to/mask_rcnn_0009.h5'', by_name=True)
model.load_weights(''/my/path/to/mask_rcnn_0010.h5'', by_name=True)
model.load_weights(''/my/path/to/mask_rcnn_0011.h5'.h5', by_name=True)


history = model.keras_model.history.history

你可以使用tensorboard

$ tensorboard --logdir logs/

logs/ -->使用您保存 .h5 文件的文件夹

you should see something like this in your browser, using https://127.0.0.1:6006/ .