暂时性屏蔽掉save() 并加上指定的.h5文件后缀

This commit is contained in:
nl 2021-11-16 22:33:34 +08:00
parent 801d2d484c
commit cc5f5dfba9
1 changed files with 4 additions and 4 deletions

View File

@ -167,11 +167,11 @@ class SpeechModel251(BaseModel):
self.model.load_weights(filename) self.model.load_weights(filename)
def save_weights(self, filename :str) -> None: def save_weights(self, filename :str) -> None:
self.model.save_weights(filename + '.model') self.model.save_weights(filename + '.model.h5')
self.model_base.save_weights(filename + '.model.base') self.model_base.save_weights(filename + '.model.base.h5')
# 需要安装 hdf5 模块 # 需要安装 hdf5 模块
self.model.save(filename + '.h5') #self.model.save(filename + '.h5')
self.model_base.save(filename + '.base.h5') #self.model_base.save(filename + '.base.h5')
f = open('epoch_'+self._model_name+'.txt','w') f = open('epoch_'+self._model_name+'.txt','w')
f.write(filename) f.write(filename)
f.close() f.close()