diff --git a/semi_seg/dsutils.py b/semi_seg/dsutils.py index 36fd7c9a..0cd2d343 100644 --- a/semi_seg/dsutils.py +++ b/semi_seg/dsutils.py @@ -38,7 +38,7 @@ def get_dataloaders(config, group_val_patient=True): f"given {labeled_data_ratio} and {unlabeled_data_ratio}") data_manager = datainterface(root_dir=DATA_PATH, labeled_data_ratio=labeled_data_ratio, unlabeled_data_ratio=unlabeled_data_ratio, verbose=False, - seed=0 if dataset_name == "acdc" else 10)# avoid bad random seed for prostate + seed=0 if dataset_name == "acdc" else 10) # avoid bad random seed for prostate label_set, unlabel_set, val_set = data_manager._create_semi_supervised_datasets( # noqa labeled_transform=augmentinferface.pretrain, diff --git a/semi_seg/scripts/run_infonce_pretrain.py b/semi_seg/scripts/run_infonce_pretrain.py index 4844e54d..535bacfb 100644 --- a/semi_seg/scripts/run_infonce_pretrain.py +++ b/semi_seg/scripts/run_infonce_pretrain.py @@ -2,7 +2,7 @@ from deepclustering2.cchelper import JobSubmiter from deepclustering2.utils import gethash - +import time from semi_seg.scripts.helper import dataset_name2class_numbers, ft_lr_zooms, BindPretrainFinetune, BindContrastive, \ BindSelfPaced, accounts @@ -135,6 +135,7 @@ def get_loss_str(begin_value, end_value): job_submiter = JobSubmiter(project_path="../", on_local=args.on_local, time=args.time, ) for j in job_array: + time.sleep(0.5) job_submiter.prepare_env( [ f"source ~/venv/bin/activate ", diff --git a/semi_seg/scripts/run_infonce_semi.py b/semi_seg/scripts/run_infonce_semi.py index 3561e385..65280ed3 100644 --- a/semi_seg/scripts/run_infonce_semi.py +++ b/semi_seg/scripts/run_infonce_semi.py @@ -1,6 +1,7 @@ # this script gives the checkpoint and perform semi-supervised learning accordingly. # involving 1 patient, 2 patient, 4 patient for ACDC dataset. import argparse +import time from deepclustering2.cchelper import JobSubmiter from deepclustering2.utils import load_yaml @@ -134,6 +135,7 @@ def parse_contrastive_args_from_path(config_path): job_submiter = JobSubmiter(project_path="../", on_local=args.on_local, time=args.time, ) for j in job_array: + time.sleep(0.5) job_submiter.prepare_env( [ f"source ~/venv/bin/activate ", diff --git a/semi_seg/transfer.sh b/semi_seg/transfer.sh index 3d3dc210..881434c8 100644 --- a/semi_seg/transfer.sh +++ b/semi_seg/transfer.sh @@ -9,7 +9,7 @@ local_folder=./runs # root@jizong.buzz:/root/main/runs/0402_semi/ \ # "${local_folder}/0402_semi_acdc/" -rsync -azP --exclude "*/*.png" --exclude "*/tra/*/*.pth" \ +rsync -azP --exclude "*/*.png" --exclude "*/tra/*/*.pth" --exclude "*/*.pth" \ --exclude "*/patient*" \ root@jizong.buzz:/root/main/runs/0416_prostate \ "${local_folder}"