ayooshkathuria / YOLO_v3_tutorial_from_scratch

Accompanying code for Paperspace tutorial series "How to Implement YOLO v3 Object Detector from Scratch"
https://blog.paperspace.com/how-to-implement-a-yolo-object-detector-in-pytorch/
2.32k stars 724 forks source link

yolov3-tiny model image dimensions error #55

Open TheArheus opened 4 years ago

TheArheus commented 4 years ago

Hello, I was following your tutorial and tried to use tiny version of yolov3 model, but I stucked in step 3. But, the normal version is working fine there. Error I have is next:

Traceback (most recent call last):
  File "C:/Users/1/PycharmProjects/untitled/yolo.py", line 285, in <module>
    pred = net(in_val, torch.cuda.is_available())
  File "C:\Users\1\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\nn\modules\module.py", line 541, in __call__
    result = self.forward(*input, **kwargs)
  File "C:/Users/1/PycharmProjects/untitled/yolo.py", line 246, in forward
    x = torch.cat((map1, map2), 1)
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 1. Got 18 and 20 in dimension 2 at C:\w\1\s\windows\pytorch\aten\src\TH/generic/THTensor.cpp:689

How can I fix this problem. Thank you