From 1e83aab681c1aacf56981c18afc5df4bf47f0ab0 Mon Sep 17 00:00:00 2001 From: JiaQi Xu <47347516+bubbliiiing@users.noreply.github.com> Date: Fri, 20 Mar 2020 19:19:44 +0800 Subject: [PATCH] Update train.py --- train.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/train.py b/train.py index d26d433..50f093e 100644 --- a/train.py +++ b/train.py @@ -41,17 +41,17 @@ if __name__ == "__main__": net = net.cuda() annotation_path = '2007_train.txt' - val_split = 0.1 with open(annotation_path) as f: lines = f.readlines() np.random.seed(10101) np.random.shuffle(lines) np.random.seed(None) - num_val = int(len(lines)*val_split) - num_train = len(lines) - num_val - gen = Generator(Batch_size, lines[:num_train], lines[num_train:], + num_train = len(lines) + + gen = Generator(Batch_size, lines, (Config["min_dim"], Config["min_dim"]), Config["num_classes"]).generate() + optimizer = optim.Adam(net.parameters(), lr=lr) criterion = MultiBoxLoss(Config['num_classes'], 0.5, True, 0, True, 3, 0.5, False, Cuda) -- GitLab