diff --git a/src/smexperiments/metrics.py b/src/smexperiments/metrics.py index 75d8c5a..503a2df 100644 --- a/src/smexperiments/metrics.py +++ b/src/smexperiments/metrics.py @@ -52,8 +52,7 @@ def log_metric(self, metric_name, value, timestamp=None, iteration_number=None): logging.debug("Writing metric: %s", raw_metric_data) self._file.write(json.dumps(raw_metric_data.to_record())) self._file.write("\n") - except AttributeError as e: - logging.error(e) + except AttributeError: if self._closed: raise SageMakerMetricsWriterException("log_metric called on a closed writer") elif not self._file: @@ -84,7 +83,9 @@ def __del__(self): def _get_metrics_file_path(self): pid_filename = "{}.json".format(str(os.getpid())) - return self._metrics_file_path or os.path.join(METRICS_DIR, pid_filename) + metrics_file_path = self._metrics_file_path or os.path.join(METRICS_DIR, pid_filename) + logging.debug("metrics_file_path=" + metrics_file_path) + return metrics_file_path class SageMakerMetricsWriterException(Exception):