76125cafc9734441b4dab036e345fbb0abf1d84a,deeppavlov/models/ner/ner_network.py,NerNetwork,load,#NerNetwork#,197
Before Change
Load session from checkpoint
saver = tf.train.Saver()
ckpt = self.get_checkpoint_state()
if ckpt and ckpt.model_checkpoint_path:
print("\n:: restoring checkpoint from", ckpt.model_checkpoint_path, "\n")
saver.restore(self._sess, ckpt.model_checkpoint_path)
print("session restored")
else:
print("\n:: <ERR> checkpoint not found! \n")
After Change
def load(self):
if self.load_path:
if isinstance(self.load_path, Path) and self.load_path.parent.is_dir():
if tf.train.get_checkpoint_state(self.load_path.parent) is not None:
saver = tf.train.Saver()
print("Restore NerNetwork model from {}".format(str(self.load_path)))
saver.restore(self._sess, str(self.load_path))
else:
warn("Provided `load_path` is incorrect!")
else:
warn("Provided `load_path` is incorrect!")
else:
warn("No `load_path` is provided for {}".format(self.__class__.__name__))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: deepmipt/DeepPavlov
Commit Name: 76125cafc9734441b4dab036e345fbb0abf1d84a
Time: 2018-01-26
Author: ol.gure@gmail.com
File Name: deeppavlov/models/ner/ner_network.py
Class Name: NerNetwork
Method Name: load
Project Name: deepmipt/DeepPavlov
Commit Name: 2e530e78c78c3f9f899143c437f55618d3038951
Time: 2018-02-18
Author: arkhipov@yahoo.com
File Name: deeppavlov/core/models/tf_model.py
Class Name: TFModel
Method Name: load
Project Name: NervanaSystems/coach
Commit Name: 5fadb9c18e3de16cc5633175199f9e9e2c381102
Time: 2018-11-07
Author: sina.beh@gmail.com
File Name: rl_coach/graph_managers/graph_manager.py
Class Name: GraphManager
Method Name: restore_checkpoint