Skip to content

Commit b8dc8d3

Browse files
Ensure max_epochs>=2 for Auto3Dseg notebooks in CI/CD (#955)
Signed-off-by: Mingxin Zheng <18563433+mingxin-zheng@users.noreply.github.com> Fixes #952 Signed-off-by: Mingxin Zheng <18563433+mingxin-zheng@users.noreply.github.com>
1 parent 81efbd4 commit b8dc8d3

File tree

5 files changed

+15
-0
lines changed

5 files changed

+15
-0
lines changed

auto3dseg/notebooks/auto3dseg_autorunner_ref_api.ipynb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,9 @@
329329
"\n",
330330
"max_epochs = 2000\n",
331331
"\n",
332+
"# safeguard to ensure max_epochs is greater or equal to 2\n",
333+
"max_epochs = max(max_epochs, 2)\n",
334+
"\n",
332335
"num_gpus = 1 if \"multigpu\" in data_src_cfg and not data_src_cfg[\"multigpu\"] else torch.cuda.device_count()\n",
333336
"\n",
334337
"num_epoch = max_epochs\n",

auto3dseg/notebooks/auto3dseg_hello_world.ipynb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,9 @@
232232
"source": [
233233
"max_epochs = 2\n",
234234
"\n",
235+
"# safeguard to ensure max_epochs is greater or equal to 2\n",
236+
"max_epochs = max(max_epochs, 2)\n",
237+
"\n",
235238
"train_param = {\n",
236239
" \"CUDA_VISIBLE_DEVICES\": [0], # use only 1 gpu\n",
237240
" \"num_iterations\": 4 * max_epochs,\n",

auto3dseg/notebooks/ensemble_byoc.ipynb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,9 @@
699699
"\n",
700700
"max_epochs = 2\n",
701701
"\n",
702+
"# safeguard to ensure max_epochs is greater or equal to 2\n",
703+
"max_epochs = max(max_epochs, 2)\n",
704+
"\n",
702705
"train_param = {\n",
703706
" \"CUDA_VISIBLE_DEVICES\": [0], # use only 1 gpu\n",
704707
" \"num_iterations\": 4 * max_epochs,\n",

auto3dseg/notebooks/hpo_nni.ipynb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@
252252
"\n",
253253
"max_epochs = 2\n",
254254
"\n",
255+
"# safeguard to ensure max_epochs is greater or equal to 2\n",
256+
"max_epochs = max(max_epochs, 2)\n",
257+
"\n",
255258
"num_gpus = 1 if \"multigpu\" in input_dict and not input_dict[\"multigpu\"] else torch.cuda.device_count()\n",
256259
"\n",
257260
"num_epoch = max_epochs\n",

auto3dseg/notebooks/hpo_optuna.ipynb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,9 @@
255255
"\n",
256256
"max_epochs = 2\n",
257257
"\n",
258+
"# safeguard to ensure max_epochs is greater or equal to 2\n",
259+
"max_epochs = max(max_epochs, 2)\n",
260+
"\n",
258261
"num_gpus = 1 if \"multigpu\" in input_dict and not input_dict[\"multigpu\"] else torch.cuda.device_count()\n",
259262
"\n",
260263
"num_epoch = max_epochs\n",

0 commit comments

Comments
 (0)