训练后如何保存 VGG-16 模型的权重?如何将保存的权重加载到模型中?
我试过这个:
fname = "weights-Test-CNN.hdf5"
custom_vgg_model.save_weights(fname,overwrite=True)
custom_vgg_model.load_weights(weights-Test-CNN.hdf5, by_name=False)
我收到以下错误:
NameError Traceback (last last call last) in () ----> 1 custom_vgg_model.load_weights(weights-Test-CNN.hdf5, by_name=False)
NameError:名称“权重”未定义