WongKinYiu / PyTorch_YOLOv4

PyTorch implementation of YOLOv4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error training your own data set

HtAgoni opened this issue · comments

Traceback (most recent call last):
File "train.py", line 537, in
train(hyp, opt, device, tb_writer, wandb)
File "train.py", line 336, in train
results, maps, times = test.test(opt.data,
File "/data3/JXT/ours/yolov4/PyTorch_YOLOv4-master/test.py", line 125, in test
inf_out, train_out = model(img, augment=augment) # inference and training outputs
File "/home/super2/anaconda3/envs/python3.8+1.8/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/data3/JXT/ours/yolov4/PyTorch_YOLOv4-master/models/models.py", line 464, in forward
return self.forward_once(x)
File "/data3/JXT/ours/yolov4/PyTorch_YOLOv4-master/models/models.py", line 537, in forward_once
x = torch.cat(x, 1) # cat yolo outputs
RuntimeError: Sizes of tensors must match except in dimension 2. Got 9 and 85 (The offending index is 0)

Can you give me an example of the code where the error is triggered?