Commit 1a10b66 1 parent 845e880 commit 1a10b66 Copy full SHA for 1a10b66
File tree 1 file changed +9
-4
lines changed
otx/algorithms/common/adapters/mmcv/utils
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -64,10 +64,15 @@ def train_func_single_iter(batch_size):
64
64
else :
65
65
copied_cfg .runner ["max_epochs" ] = 1
66
66
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 ]
71
76
72
77
new_datasets = [SubDataset (datasets [0 ], batch_size )]
73
78
You can’t perform that action at this time.
0 commit comments