286a864220a00732d382a75051e11877acf13c3f,deeppavlov/core/models/keras_model.py,KerasModel,save,#KerasModel#Any#,254
Before Change
Returns:
Nothing
if self.ser_path.is_dir():
opt_path = "{}/{}_opt.json".format(self.ser_path, self._ser_file)
weights_path = "{}/{}.h5".format(self.ser_path, self._ser_file)
else:
// TODO: something is incorrect with ser_path if dir but does not exist
opt_path = "{}_opt.json".format(self.ser_path)
weights_path = "{}.h5".format(self.ser_path)
print("[ saving model: {} ]".format(opt_path))
self.ser_path.mkdir(parents=True, exist_ok=True)
self.model.save_weights(weights_path)
After Change
Returns:
Nothing
if not self.save_path:
raise ConfigError("No `save_path` is provided for Keras model!")
elif isinstance(self.save_path, Path) and not self.save_path.parent.is_dir():
raise ConfigError("Provided save path is incorrect!")
else:
opt_path = "{}_opt.json".format(str(self.save_path.resolve()))
weights_path = "{}.h5".format(str(self.save_path.resolve()))
print("[ saving model: {} ]".format(opt_path))
self.model.save_weights(weights_path)
save_json(self.opt, opt_path)
return True
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 10
Instances
Project Name: deepmipt/DeepPavlov
Commit Name: 286a864220a00732d382a75051e11877acf13c3f
Time: 2018-01-24
Author: ol.gure@gmail.com
File Name: deeppavlov/core/models/keras_model.py
Class Name: KerasModel
Method Name: save
Project Name: deepmipt/DeepPavlov
Commit Name: 2735b8432c474da52b31c26500bda37b2969f615
Time: 2018-01-23
Author: ol.gure@gmail.com
File Name: deeppavlov/core/models/tf_model.py
Class Name: TFModel
Method Name: save
Project Name: deepmipt/DeepPavlov
Commit Name: 977fe901da32c0b440d405f4ca2a6d6a1e18d0c5
Time: 2018-01-23
Author: ol.gure@gmail.com
File Name: deeppavlov/core/models/tf_model.py
Class Name: TFModel
Method Name: save