| 73 | collection_list=self.graph.get_all_collection_keys()) |
| 74 | |
| 75 | def _trigger(self): |
| 76 | try: |
| 77 | self.saver.save( |
| 78 | tf.get_default_session(), |
| 79 | self.path, |
| 80 | global_step=tf.train.get_global_step(), |
| 81 | write_meta_graph=False) |
| 82 | logger.info("Model saved to %s." % tf.train.get_checkpoint_state(self.checkpoint_dir).model_checkpoint_path) |
| 83 | except (IOError, tf.errors.PermissionDeniedError, |
| 84 | tf.errors.ResourceExhaustedError, |
| 85 | tf.errors.AlreadyExistsError): # disk error sometimes.. just ignore it |
| 86 | logger.exception("Exception in ModelSaver!") |
| 87 | |
| 88 | |
| 89 | class MinSaver(Callback): |