diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-25 13:25:02 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-25 13:25:02 +0200 |
| commit | 237a32c596f37a38c07902332adc1af4c0c43609 (patch) | |
| tree | 58b3a91372be4c0fa0d13c8f7f242cd87285e091 /app/relay/modules/pix2pixhd.js | |
| parent | 9359758ce631528ae2b0deb82df05f908d5c42a2 (diff) | |
app bugz
Diffstat (limited to 'app/relay/modules/pix2pixhd.js')
| -rw-r--r-- | app/relay/modules/pix2pixhd.js | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/app/relay/modules/pix2pixhd.js b/app/relay/modules/pix2pixhd.js index ccfd334..d5d6ada 100644 --- a/app/relay/modules/pix2pixhd.js +++ b/app/relay/modules/pix2pixhd.js @@ -48,14 +48,14 @@ const train = { const dataset = task.dataset.toLowerCase() const datasets_path = path.join(cwd, 'datasets', dataset) const checkpoints_path = path.join(cwd, 'checkpoints', dataset) + const iter_txt = path.join(checkpoints_path, 'iter.txt') + console.log(dataset, datasets_path, checkpoints_path) if (fs.existsSync(checkpoints_path)) { - try { - const checkpoints = fs.readdirSync(checkpoints_path) - checkpoints.forEach(name => { - epoch = Math.max(parseInt(name) || 0, epoch) - }) - console.log(task.module, dataset, epoch, task.epochs) - } catch (e) { } + const iter = fs.readFileSync(iter_txt).split('\n') + epoch = iter[0] || 0 + console.log(task.module, dataset, '=>', epoch, task.epochs) + } else { + console.log(task.module, dataset, '=>', 'starting new training') } let args = [ '--dataroot', datasets_path, @@ -68,7 +68,6 @@ const train = { ] if (epoch) { args = args.concat([ - '--epoch_count', task.epoch + task.epochs + 1, '--which_epoch', 'latest', '--continue_train', ]) |
