未验证 提交 1e83aab6 编写于 作者: J JiaQi Xu 提交者: GitHub

Update train.py

上级 077e1c96
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册