From a4f6d0e9afa4993437e3031aaa4771f268ce4d99 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 5 Sep 2018 13:28:55 +0200 Subject: app --- app/client/modules/pix2pixhd/pix2pixhd.tasks.js | 6 +++++- app/client/modules/pix2pixhd/views/pix2pixhd.train.js | 19 ++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) (limited to 'app/client/modules/pix2pixhd') diff --git a/app/client/modules/pix2pixhd/pix2pixhd.tasks.js b/app/client/modules/pix2pixhd/pix2pixhd.tasks.js index bd51f2b..412f066 100644 --- a/app/client/modules/pix2pixhd/pix2pixhd.tasks.js +++ b/app/client/modules/pix2pixhd/pix2pixhd.tasks.js @@ -26,13 +26,17 @@ export const train_task = (dataset, folder_id, epochs=1) => dispatch => { const task = { module: module.name, activity: 'train', - dataset: dataset.name, + dataset: dataset.name || dataset, epoch: 0, epochs: epochs, opt: { folder_id: folder_id, } } + if (!task.dataset) { + console.error("train task: no dataset specified") + return + } console.log(task) return actions.queue.add_task(task) } diff --git a/app/client/modules/pix2pixhd/views/pix2pixhd.train.js b/app/client/modules/pix2pixhd/views/pix2pixhd.train.js index ace93e4..b029eab 100644 --- a/app/client/modules/pix2pixhd/views/pix2pixhd.train.js +++ b/app/client/modules/pix2pixhd/views/pix2pixhd.train.js @@ -64,6 +64,10 @@ class Pix2PixHDTrain extends Component { console.log('name', name, 'value', value) this.setState({ [name]: value }) } + interrupt(){ + this.props.actions.queue.stop_task('gpu') + } + render(){ if (this.props.pix2pixhd.loading) { return @@ -89,9 +93,9 @@ class Pix2PixHDTrain extends Component { } }).filter(n => !!n && !!n.options.length).sort((a,b) => a.name.localeCompare(b.name)) - console.log('state', this.props.pix2pixhd.data.epochs) + // console.log('state', this.props.pix2pixhd.data.epochs) // console.log(this.state.checkpoint_name, this.state.epoch) - + console.log(queue) return (
@@ -160,12 +164,20 @@ class Pix2PixHDTrain extends Component { onClick={() => this.props.remote.clear_recursive_task(this.state.checkpoint_name)} /> + + +
{!!queue.queue.length && - queue.tasks[id])} /> + queue.tasks[id])} sort="date asc" /> }
@@ -176,6 +188,7 @@ class Pix2PixHDTrain extends Component { const mapStateToProps = state => ({ pix2pixhd: state.module.pix2pixhd, + runner: state.system.runner, queue: state.queue, }) -- cgit v1.2.3-70-g09d2