def copy_model(self, model, config):
from keras.utils.generic_utils import get_custom_objects
from Model import IdentityConv, GroupIdentityConv
get_custom_objects()['IdentityConv'] = IdentityConv
get_custom_objects()['GroupIdentityConv'] = GroupIdentityConv
new_model = MyModel(config, model.graph.copy(), keras.models.load_model(model.config.model_path))
keras.models.save_model(new_model.model, new_model.config.model_path)
return new_model
评论列表
文章目录