yolov4-tf2 icon indicating copy to clipboard operation
yolov4-tf2 copied to clipboard

将训练结果保存为.h5模型后无法用tf.keras.models.load_model加载

Open Duton opened this issue 2 years ago • 6 comments

修改save_weights_only = False将训练结果保存为模型后无法用tf.keras.models.load_model加载 2022-04-04 20-01-25 的屏幕截图

Duton avatar Apr 04 '22 12:04 Duton

您好,我想请问怎样将训练结果保存为可以用于加载和部署的模型,我在加载保存的模型时碰到以下问题 2022-04-05 15-44-00 的屏幕截图 2022-04-05 16-01-54 的屏幕截图

Duton avatar Apr 05 '22 09:04 Duton

loss不能这样保存吧,你可以预测的时候 save model

bubbliiiing avatar Apr 08 '22 16:04 bubbliiiing

你好我用tf.keras.save_model 然后再load的时候也是这个问题 看起来好像是这个get_anchors_and_decode有点问题

yxd117 avatar Jun 10 '22 05:06 yxd117

预测的时候,不是训练

bubbliiiing avatar Jun 10 '22 13:06 bubbliiiing

对是预测的时候,大概发现问题了, load的时候需要import utils.bbox这个函数, 因为整个模型用了 custom objects. 可参考 https://www.tensorflow.org/guide/keras/save_and_serialize#custom_objects

yxd117 avatar Jun 13 '22 06:06 yxd117

0 0 哇hu

bubbliiiing avatar Jun 13 '22 11:06 bubbliiiing