diff --git a/atlas_server/src/app.py b/atlas_server/src/app.py index 6c77bdc5ffe0c4670ea783a5187304eb6d7048c1..a4501ccb3525b48dce9742d9b99bbe5753bdcd8f 100644 --- a/atlas_server/src/app.py +++ b/atlas_server/src/app.py @@ -267,12 +267,14 @@ class TaskJobList(Resource): annotations = task.annotations # noinspection PyUnresolvedReferences job_type = job_configuration.job_type - if job_type.lower() in ("training", "train"): + if job_type.lower() in ("training", "train", "training_prediction", "train_predict", "train+predict"): + with_prediction = "predict" in job_type.lower() job_id = submit_training_job(brain=brain, annotations=annotations, job_configuration=job_configuration, project_id=project_id, task_id=task_id, + with_prediction=with_prediction, **kwargs) elif job_type in ("prediction", "predict"): job_id = submit_prediction_job(brain=brain, diff --git a/atlas_server/src/scheduler.py b/atlas_server/src/scheduler.py index 950c93c867e798cda0dcf559fcb28fec2fc338e4..bb71bf7396d5661af3991a8a53d0454c194cb9a4 100644 --- a/atlas_server/src/scheduler.py +++ b/atlas_server/src/scheduler.py @@ -56,7 +56,7 @@ def _setup_training_config_file(config_file, brain, annotations, **kwargs): return config_content -def submit_training_job(brain, annotations, job_configuration, project_id, task_id, **kwargs): +def submit_training_job(brain, annotations, job_configuration, project_id, task_id, with_prediction=False, **kwargs): additional_files = [] # Create the working directory path by combining project and task id @@ -101,7 +101,12 @@ def submit_training_job(brain, annotations, job_configuration, project_id, task_ labels = sorted(list(labels)) # Read the job script end encode its content - script_path = os.path.join(STATIC_DIR, "training/train.job.sh") + if with_prediction: + fname = "training/train_predict.job.sh" + else: + fname = "training/train.job.sh" + + script_path = os.path.join(STATIC_DIR, fname) with open(script_path, "r") as f: # Replace labels in job file content = f.read() diff --git a/microdraw/src/atlas_ui.js b/microdraw/src/atlas_ui.js index ff36034a6b785544f62a8024a3c573d32e3ff734..397710fbf1ccde6b0cbc59a47f6b2a3f7d40d8e2 100644 --- a/microdraw/src/atlas_ui.js +++ b/microdraw/src/atlas_ui.js @@ -509,15 +509,22 @@ var app = new Vue({ } }); }, - submitTrainingJob(project, task) { + submitTrainingPredictionJob(project, task) { + this.submitTrainingJob(project, task, true); + }, + submitTrainingJob(project, task, with_prediction=false) { + let job_type = "training"; + if (with_prediction) { + job_type = "train+predict"; + } let job_configuration = new JobConfiguration( // account "jinm16", // "jinm16", // time - "01:00:00", + "03:00:00", // job_type - "training", + job_type, // gres // "", "gpu:4", diff --git a/microdraw/src/microdraw.html b/microdraw/src/microdraw.html index 8a75df0d3c4faf65efb1b5735cac6c2a2708665e..fdb69ae9e2700dea6a08eda6641b10fdff64c6a8 100755 --- a/microdraw/src/microdraw.html +++ b/microdraw/src/microdraw.html @@ -300,6 +300,7 @@ <div class="btn-group" role="group"> <button type="button" class="btn btn-info" v-on:click="submitAllJobsForProject(selected_project, submitTrainingJob)">Train all</button> <button type="button" class="btn btn-info" v-on:click="submitAllJobsForProject(selected_project, submitPredictionJob)">Predict all</button> + <button type="button" class="btn btn-info" v-on:click="submitAllJobsForProject(selected_project, submitTrainingPredictionJob)">Train+Predict all</button> <button type="button" class="btn btn-danger" v-on:click="cancelAllJobsForProject(selected_project)">Cancel all</button> </div> </div> @@ -651,6 +652,7 @@ <div class="btn-group" role="group"> <button type="button" class="btn btn-primary" v-on:click="submitTrainingJob(selected_project, selected_task)">Start training</button> <button type="button" class="btn btn-primary" v-on:click="submitPredictionJob(selected_project, selected_task)">Start prediction</button> + <button type="button" class="btn btn-primary" v-on:click="submitTrainingPredictionJob(selected_project, selected_task)">Start training & prediction</button> <button type="button" class="btn btn-secondary" v-on:click="getJobStatusForAll(selected_project, selected_task)">Update all</button> <!-- <button type="button" class="btn btn-danger" v-on:click="cancelAllJobs(selected_project, selected_task)">Cancel all</button> -->