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


        
        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))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

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: azavea/raster-vision
Commit Name: 2b6f090645d9beab38c19230d940b34031e95b34
Time: 2018-12-07
Author: skassel@azavea.com
File Name: rastervision/command/chip_command_config.py
Class Name: ChipCommandConfigBuilder
Method Name: validate


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: load