def begin(self): self._predictions = misc.get_dict_from_collection("predictions") if not self._predictions: raise RuntimeError("The model did not define any predictions.") self._global_step = tf.train.get_global_step() if self._global_step is None: raise RuntimeError("Global step should be created to use SaveEvaluationPredictionHook.")
def begin(self): self._predictions = misc.get_dict_from_collection("predictions") self._saver = tf.train.Saver() if not self._predictions: raise RuntimeError("The model did not define any predictions.") self._global_step = tf.train.get_global_step() if self._global_step is None: raise RuntimeError( "Global step should be created to use SaveEvaluationPredictionHook." ) if self._best_models_dir is not None: if not os.path.exists(self._best_models_dir): os.makedirs(self._best_models_dir)