summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/client/dashboard/dashboard.actions.js12
-rw-r--r--app/client/dashboard/dashboard.component.js10
-rw-r--r--app/relay/modules/pix2pixhd.js15
3 files changed, 20 insertions, 17 deletions
diff --git a/app/client/dashboard/dashboard.actions.js b/app/client/dashboard/dashboard.actions.js
index 567f2cb..ae54f02 100644
--- a/app/client/dashboard/dashboard.actions.js
+++ b/app/client/dashboard/dashboard.actions.js
@@ -6,12 +6,13 @@ export const load = () => (dispatch) => {
util.allProgress([
actions.task.index({ limit: 40, orderBy: 'created_at desc', }),
actions.folder.index({ activity: 'dataset', }),
- actions.file.index({ module: 'samplernn', generated: 1, limit: 10, orderBy: 'created_at desc', })
+ actions.file.index({ module: 'samplernn', generated: 1, limit: 15, orderBy: 'created_at desc', }),
+ actions.file.index({ module: 'pix2pixhd', generated: 1, limit: 15, orderBy: 'created_at desc', }),
], (percent, i, n) => {
console.log('dashboard load progress', i, n)
dispatch({ type: types.app.load_progress, progress: { i, n }})
}).then(res => {
- const [ tasks, folders, sampleRNNrenders ] = res
+ const [ tasks, folders, samplernn, pix2pixhd ] = res
const { mapFn, sortFn } = util.sort.orderByFn('date desc')
const foldersByModule = folders.map(mapFn).sort(sortFn).reduce((a,b) => {
const module = b[1].module
@@ -24,10 +25,13 @@ export const load = () => (dispatch) => {
data: {
tasks,
folders,
- sampleRNNrenders,
+ renders: {
+ samplernn,
+ pix2pixhd,
+ },
foldersByModule,
},
})
})
-} \ No newline at end of file
+}
diff --git a/app/client/dashboard/dashboard.component.js b/app/client/dashboard/dashboard.component.js
index 1e037bc..58795ee 100644
--- a/app/client/dashboard/dashboard.component.js
+++ b/app/client/dashboard/dashboard.component.js
@@ -30,7 +30,7 @@ class Dashboard extends Component {
// this.props.actions.list_epochs(nextProps.opt.checkpoint_name)
}
render(){
- const { site, foldersByModule, sampleRNNrenders, queue, images } = this.props
+ const { site, foldersByModule, renders, queue, images } = this.props
const { tasks } = queue
const folders = foldersByModule && Object.keys(modules).sort().map(key => {
if (! foldersByModule[key]) return null
@@ -42,10 +42,10 @@ class Dashboard extends Component {
</div>
)
})
- const files = key === 'samplernn' && (
+ let files = renders[key] && (
<FileList
linkFiles
- files={sampleRNNrenders}
+ files={renders[key]}
orderBy='date desc'
fields={'name date epoch size'}
onClick={(file, e) => {
@@ -55,7 +55,7 @@ class Dashboard extends Component {
this.handlePick(file)
}}
/>
- )
+ );
return (
<div className='dashboardModule' key={key}>
@@ -100,7 +100,7 @@ class Dashboard extends Component {
const mapStateToProps = state => ({
site: state.system.site,
foldersByModule: state.dashboard.data.foldersByModule,
- sampleRNNrenders: state.dashboard.data.sampleRNNrenders,
+ renders: state.dashboard.data.renders,
images: state.dashboard.images,
files: state.dashboard.files,
queue: state.queue,
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',
])