From 608178533e93dc7e6fac6059fa139233ab046b63 Mon Sep 17 00:00:00 2001 From: Jordan Gong Date: Wed, 16 Mar 2022 16:55:32 +0800 Subject: Make checkpoint directories together with tensorboard logs --- supervised/baseline.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'supervised/baseline.py') diff --git a/supervised/baseline.py b/supervised/baseline.py index 63d3416..d5671b1 100644 --- a/supervised/baseline.py +++ b/supervised/baseline.py @@ -32,9 +32,6 @@ LR = 1 MOMENTUM = 0.9 WEIGHT_DECAY = 1e-6 -if not os.path.exists(CHECKPOINT_PATH): - os.makedirs(CHECKPOINT_PATH) - random.seed(SEED) torch.manual_seed(SEED) device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') @@ -151,6 +148,8 @@ scheduler = LinearWarmupAndCosineAnneal( if OPTIM == 'lars': optimizer = LARS(optimizer) +if not os.path.exists(CHECKPOINT_PATH): + os.makedirs(CHECKPOINT_PATH) writer = SummaryWriter(TENSORBOARD_PATH) curr_train_iters = RESTORE_EPOCH * num_train_batches -- cgit v1.2.3