Skip to content
Snippets Groups Projects
Commit d667b698 authored by Schneider Leo's avatar Schneider Leo
Browse files

fix : checkpoint path

fix : cpu per task
parent 940fd506
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@ def load_args_contrastive():
parser.add_argument('--dataset_val_dir', type=str, default='data/processed_data/npy_image/data_test_contrastive')
parser.add_argument('--dataset_test_dir', type=str, default=None)
parser.add_argument('--base_out', type=str, default='output/baseline')
parser.add_argument('--dataset_ref_dir', type=str, default='image_ref/img_ref')
parser.add_argument('-- ', type=str, default='image_ref/img_ref')
parser.add_argument('--output', type=str, default='output/out_contrastive.csv')
parser.add_argument('--save_path', type=str, default='output/best_model_constrastive.pt')
parser.add_argument('--pretrain_path', type=str, default=None)
......
......@@ -133,7 +133,7 @@ def train_model(config,args):
# Note to save a file like checkpoint, you still need to put it under a directory
# to construct a checkpoint.
with tempfile.TemporaryDirectory(
dir='lustre/fswork/projects/rech/bun/ucg81ws/these/pseudo_image/checkpoints') as temp_checkpoint_dir:
dir='/lustre/fswork/projects/rech/bun/ucg81ws/these/pseudo_image/checkpoints') as temp_checkpoint_dir:
path = os.path.join(temp_checkpoint_dir, "checkpoint.pt")
torch.save(
......@@ -212,7 +212,7 @@ def test_model(best_result, args):
def main(args, gpus_per_trial=1):
config = {
"lr": tune.loguniform(1e-4, 1e-2),
"noise": tune.loguniform(1e-7, 500),
"noise": tune.loguniform(1, 1000),
"positive_prop": tune.uniform(0, 100),
"optimizer": tune.choice(['Adam', 'SGD']),
"sampler": tune.choice(['random', 'balanced']),
......@@ -228,7 +228,7 @@ def main(args, gpus_per_trial=1):
tuner = tune.Tuner(
tune.with_resources(
tune.with_parameters(train_model, args=args),
resources={"cpu": 80, "gpu": gpus_per_trial}
resources={"cpu": 20, "gpu": gpus_per_trial}
),
tune_config=tune.TuneConfig(
time_budget_s=3600 * 23.5,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment