Skip to content

Commit 8054d1a

Browse files
author
Phuc Le
committed
minor fix: Save model at epoch
1 parent 3a89e0f commit 8054d1a

File tree

4 files changed

+28
-15
lines changed

4 files changed

+28
-15
lines changed

scripts/evaluate.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
python evaluate.py --model ORIG_STG2 --experiment adam_trueWD_cyclical \
2-
--loadPath ORIG_STG2_adam_trueWD_cyclical \
3-
--chunkSize 32 --batchSize 32 \
4-
--gpu 0
5-
6-
# python evaluate.py --model ORIG_STG2 --experiment sgd_trueWD_restart \
1+
# python evaluate.py --model ORIG_STG2 --experiment adam_trueWD_cyclical \
72
# --loadPath ORIG_STG2_adam_trueWD_cyclical \
83
# --chunkSize 32 --batchSize 32 \
94
# --gpu 0
5+
6+
python evaluate.py --model ORIG_STG2 --experiment sgd_trueWD_restart \
7+
--loadPath ORIG_STG2_sgd_trueWD_restart \
8+
--chunkSize 32 --batchSize 32 \
9+
--gpu 0

scripts/evaluate_dist.sh

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
python evaluate_dist.py --model ORIG_STG2 --experiment adam_trueWD_cyclical \
2-
--loadPath ORIG_STG2_adam_trueWD_cyclical \
3-
--chunkSize 32 --batchSize 32
4-
5-
# python evaluate.py --model ORIG_STG2 --experiment sgd_trueWD_restart \
1+
# python evaluate_dist.py --model ORIG_STG2 --experiment adam_trueWD_cyclical \
62
# --loadPath ORIG_STG2_adam_trueWD_cyclical \
3+
# --chunkSize 32 --batchSize 32
4+
5+
# python evaluate_dist.py --model ORIG_STG2 --experiment sgd_trueWD_restart \
6+
# --loadPath ORIG_STG2_sgd_trueWD_restart \
77
# --chunkSize 32 --batchSize 32 \
88
# --gpu 0
9+
10+
python evaluate_dist.py --model ORIG_STG2 --experiment orig_tf \
11+
--loadPath "~/3D-point-cloud-generation/results_0/orig-ft_it100000" \
12+
--chunkSize 32 --batchSize 32 \
13+
--gpu 1

scripts/train_stg2.sh

+11-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,17 @@
2727
# --lrSched restart --T_0 5 --T_mult 2 --lrBase 5e-2 \
2828
# --gpu 0
2929

30-
python train_stg2.py --model ORIG_STG2 --experiment sgd_trueWD_restart \
31-
--loadPath ORIG_STG1_sgd_trueWD_restart \
32-
--chunkSize 32 --batchSize 32 \
30+
# python train_stg2.py --model ORIG_STG2 --experiment sgd_trueWD_restart \
31+
# --loadPath ORIG_STG1_sgd_trueWD_restart \
32+
# --chunkSize 32 --batchSize 32 \
33+
# --optim sgd --trueWD 1e-4 --lr 1e-1 \
34+
# --lrSched restart --T_0 5 --T_mult 2 --lrBase 5e-3 \
35+
# --gpu 1
36+
37+
# Continue training
38+
python train_stg2.py --model ORIG_STG2 --experiment sgd_trueWD_restart_cont \
39+
--loadPath ORIG_STG2_sgd_trueWD_restart_cont \
40+
--chunkSize 32 --batchSize 32 --saveEpoch 10 \
3341
--optim sgd --trueWD 1e-4 --lr 1e-1 \
3442
--lrSched restart --T_0 5 --T_mult 2 --lrBase 5e-3 \
3543
--gpu 1

utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def save_best_model(model_path, model, df_hist):
165165
torch.save(model.state_dict(), f"{model_path}/best.pth")
166166

167167
def checkpoint_model(model_path, model, epoch, saveEpoch):
168-
if (saveEpoch is not None) and ((epoch+1) % saveEpoch == 0):
168+
if (saveEpoch is not None) and (epoch % saveEpoch == 0):
169169
torch.save(model.state_dict(), f"{model_path}/{epoch}.pth")
170170

171171

0 commit comments

Comments
 (0)