Skip to content

Commit

Permalink
experiments 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Brilliant-B committed Aug 8, 2023
1 parent 23db5d9 commit 91ca6fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ def main(args, info, verbose=False):
timestamp = time.strftime('%Y%m%d_%H%M%S', time.localtime())
log_file = osp.join(cfg.work_dir.replace("/hy-tmp/", ""), f'{timestamp}.log')
logger = get_root_logger(log_file=log_file, log_level=cfg.log_level)
logger.info(f"Neck: {neck_name}; Finetune_code: {finetune_code}")

# init the meta dict to record some important information such as
# environment info and seed, which will be logged
Expand All @@ -234,9 +235,10 @@ def main(args, info, verbose=False):

# set random seeds
if args.seed is not None:
logger.info(f'Distributed training: {distributed}')
logger.info(f'Set random seed to {args.seed}, deterministic: '
f'{args.deterministic}')
if verbose:
logger.info(f'Distributed training: {distributed}')
logger.info(f'Set random seed to {args.seed}, deterministic: '
f'{args.deterministic}')
set_random_seed(args.seed, deterministic=args.deterministic)
cfg.seed = args.seed
meta['seed'] = args.seed
Expand Down Expand Up @@ -281,10 +283,11 @@ def main(args, info, verbose=False):

if __name__ == '__main__':
args = parse_args()
neck_choices = ["linear", "fpn", "sfp"]
neck_choices = ["fpn", "sfp", "linear"]
# finetune_code = {0: no-freeze, 1: freeze EVA}
for n in neck_choices:
hyper_info = {
"finetune_code": 1,
"finetune_code": 0,
"config_neck": n,
}
main(args, hyper_info)
2 changes: 1 addition & 1 deletion train.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
GPU=0
NAME="eva2_segmenter"
WORK_DIR="/hy-tmp/workbench/${NAME}/train/"
RESUME="/hy-tmp/neck_linear_finetune_0/iter_6000.pth"
RESUME=""
LOAD=""

python train.py --seed 0 --deterministic --gpu-ids ${GPU} \
Expand Down

0 comments on commit 91ca6fc

Please sign in to comment.