Skip to content

Commit

Permalink
training/tensorflow: ignore content on stderr if printing metrics pro…
Browse files Browse the repository at this point in the history
…duced something

Tensorflow 1.13 (required to use Python 3.7) emiths a DeprecationWarning
when genie-print-metrics is used, because the summary iterator
uses deprecated API internally (sad).
  • Loading branch information
gcampax committed Feb 20, 2019
1 parent 4dfd51a commit 59062e0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/training/tensorflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,15 @@ module.exports = class TensorflowTrainingJob extends BaseTrainingJob {
`--${this.config.eval_early_stopping_metric_minimize ? '' : 'no'}eval_early_stopping_metric_minimize`,
]);

if (stderr)
throw new Error(stderr);

this.metrics = {};
stdout = stdout.trim();
if (!stdout) {
if (stderr)
throw new Error(stderr);
else
throw new Error(`Failed to print metrics`);
}

this.metrics = {};
const prefix = 'metrics-' + this.config.problem + '/';
for (let line of stdout.split('\n')) {
let [key, value] = line.split('=');
Expand Down

0 comments on commit 59062e0

Please sign in to comment.