diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-21 10:40:16 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-21 10:40:16 +0200 |
| commit | 6360cc030a038ee64b2832bb0a5003513550a373 (patch) | |
| tree | b2a3131b914840b26c39df67ff26652ed623bad7 | |
| parent | a6df1137b514b40dd6c5297fb0211af97ed8e471 (diff) | |
FIX RETRAIN LOGIC
| -rw-r--r-- | app/relay/modules/pix2pixhd.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/relay/modules/pix2pixhd.js b/app/relay/modules/pix2pixhd.js index 02431e5..3613e1c 100644 --- a/app/relay/modules/pix2pixhd.js +++ b/app/relay/modules/pix2pixhd.js @@ -45,22 +45,22 @@ const train = { script: 'train.py', params: (task) => { let epoch = 0 - - const datasets_path = path.join(cwd, 'datasets', task.dataset) - const checkpoints_path = path.join(cwd, 'checkpoints', task.dataset) + const dataset = task.dataset.toLowerCase() + const datasets_path = path.join(cwd, 'datasets', dataset) + const checkpoints_path = path.join(cwd, 'checkpoints', dataset) if (fs.existsSync(checkpoints_path)) { try { const checkpoints = fs.readdirSync(checkpoints_path) - checkpoints.forEach(c => { - epoch = Math.max(parseInt(c.name) || 0, epoch) + checkpoints.forEach(name => { + epoch = Math.max(parseInt(name) || 0, epoch) }) - console.log(task.module, task.dataset, epoch, task.epochs) + console.log(task.module, dataset, epoch, task.epochs) } catch (e) { } } let args = [ '--dataroot', datasets_path, '--module_name', task.module, - '--name', task.dataset, + '--name', dataset, '--model', 'pix2pixHD', '--label_nc', 0, '--no_instance', '--niter', task.epochs, |
