Skip to content

Commit

Permalink
adding sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
jizong committed Apr 14, 2021
1 parent c44b4dc commit e7481ca
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion semi_seg/dsutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion semi_seg/scripts/run_infonce_pretrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 ",
Expand Down
2 changes: 2 additions & 0 deletions semi_seg/scripts/run_infonce_semi.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 ",
Expand Down
2 changes: 1 addition & 1 deletion semi_seg/transfer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ local_folder=./runs
# [email protected]:/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*" \
[email protected]:/root/main/runs/0416_prostate \
"${local_folder}"
Expand Down

0 comments on commit e7481ca

Please sign in to comment.