5fadb9c18e3de16cc5633175199f9e9e2c381102,rl_coach/graph_managers/graph_manager.py,GraphManager,restore_checkpoint,#GraphManager#,493
Before Change
if hasattr(self.task_parameters, "checkpoint_restore_dir") and self.task_parameters.checkpoint_restore_dir:
import tensorflow as tf
checkpoint_dir = self.task_parameters.checkpoint_restore_dir
checkpoint = tf.train.get_checkpoint_state(checkpoint_dir)
screen.log_title("Loading checkpoint: {}".format(checkpoint.model_checkpoint_path))
variables = {}
for var_name, _ in tf.contrib.framework.list_variables(checkpoint_dir):
// Load the variable
After Change
// TODO: find better way to load checkpoints that were saved with a global network into the online network
if hasattr(self.task_parameters, "checkpoint_restore_dir") and self.task_parameters.checkpoint_restore_dir:
if self.task_parameters.framework_type == Frameworks.tensorflow:
self._restore_checkpoint_tf(self.task_parameters.checkpoint_restore_dir)
elif self.task_parameters.framework_type == Frameworks.mxnet:
// TODO implement checkpoint restore
pass
else:
raise ValueError("Invalid framework {}".format(self.task_parameters.framework_type))
def occasionally_save_checkpoint(self):
// only the chief process saves checkpoints
if self.task_parameters.checkpoint_save_secs \
and time.time() - self.last_checkpoint_saving_time >= self.task_parameters.checkpoint_save_secs \
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances 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
Project Name: deepmipt/DeepPavlov
Commit Name: 6b33ca24d5df63dcae69f4e6140327f5fecbc897
Time: 2018-01-26
Author: ol.gure@gmail.com
File Name: deeppavlov/core/models/tf_model.py
Class Name: TFModel
Method Name: get_checkpoint_state
Project Name: deepmipt/DeepPavlov
Commit Name: 0ddd27b71f54be5682da90473d00ea671a3459ca
Time: 2018-01-29
Author: arkhipov@yahoo.com
File Name: deeppavlov/core/models/tf_model.py
Class Name: TFModel
Method Name: get_checkpoint_state