mirror of https://github.com/WongKinYiu/yolov7.git
New Train val set split Swiss-snow-2018 to training(test19g_sy_rd_ch) val:Test46c_ml_rd_il
parent
2de1a2593c
commit
6c577e95c9
57320
tir_od/training_set.txt
57320
tir_od/training_set.txt
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
9
train.py
9
train.py
|
@ -359,6 +359,11 @@ def train(hyp, opt, device, tb_writer=None):
|
|||
nb = len(dataloader) # number of batches
|
||||
assert mlc < nc, 'Label class %g exceeds nc=%g in %s. Possible class labels are 0-%g' % (mlc, nc, opt.data, nc - 1)
|
||||
|
||||
|
||||
with open(save_dir / 'trainig_set.txt', 'w') as f:
|
||||
for file in dataset.img_files:
|
||||
f.write(f"{file}\n")
|
||||
|
||||
# Process 0
|
||||
if rank in [-1, 0]:
|
||||
testloader , test_dataset = create_dataloader(test_path, imgsz_test, batch_size * 2, gs, opt, # testloader
|
||||
|
@ -370,6 +375,10 @@ def train(hyp, opt, device, tb_writer=None):
|
|||
mlc = np.concatenate(test_dataset.labels, 0)[:, 0].max() # max label class
|
||||
assert mlc < nc, 'Label class %g exceeds nc=%g in %s. Possible class labels are 0-%g' % ( mlc, nc, opt.data, nc - 1)
|
||||
|
||||
with open(save_dir / 'test_set.txt', 'w') as f:
|
||||
for file in test_dataset.img_files:
|
||||
f.write(f"{file}\n")
|
||||
|
||||
if not opt.resume:
|
||||
labels = np.concatenate(dataset.labels, 0)
|
||||
c = torch.tensor(labels[:, 0]) # classes
|
||||
|
|
Loading…
Reference in New Issue