Skip to content

Commit 1a10b66

Browse files
authored
Bug fix: Progress goes 100% and back 0 % repeatedly during auto decrease bs in Geti (#2074)
* disable OTXProgressHook * align with pre commit
1 parent 845e880 commit 1a10b66

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

otx/algorithms/common/adapters/mmcv/utils/automatic_bs.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,15 @@ def train_func_single_iter(batch_size):
6464
else:
6565
copied_cfg.runner["max_epochs"] = 1
6666

67-
if not validate: # disable validation
68-
for hook in copied_cfg.custom_hooks:
69-
if hook["type"] == "AdaptiveTrainSchedulingHook":
70-
hook["enable_eval_before_run"] = False
67+
otx_prog_hook_idx = None
68+
for i, hook in enumerate(copied_cfg.custom_hooks):
69+
if not validate and hook["type"] == "AdaptiveTrainSchedulingHook":
70+
hook["enable_eval_before_run"] = False
71+
elif hook["type"] == "OTXProgressHook":
72+
otx_prog_hook_idx = i
73+
74+
if otx_prog_hook_idx is not None:
75+
del copied_cfg.custom_hooks[otx_prog_hook_idx]
7176

7277
new_datasets = [SubDataset(datasets[0], batch_size)]
7378

0 commit comments

Comments
 (0)