Pytorch-yolov3: Issue when detecting with own weights

Created on 25 Jul 2018  路  1Comment  路  Source: eriklindernoren/PyTorch-YOLOv3

I trained the model on my own dataset, and got weights from that. When I want to detect objects using these weights, I get the following error:

Traceback (most recent call last): File "detect_OP.py", line 42, in <module> model.load_weights(opt.weights_path) File "/home/robzelluf/Desktop/PyTorch-YOLOv3/models.py", line 265, in load_weights conv_w = torch.from_numpy(weights[ptr:ptr + num_w]).view_as(conv_layer.weight) File "/home/robzelluf/.local/lib/python3.5/site-packages/torch/tensor.py", line 230, in view_as return self.view(tensor.size()) RuntimeError: invalid argument 2: size '[1024 x 512 x 3 x 3]' is invalid for input with 3837339 elements at /pytorch/aten/src/TH/THStorage.c:41

Can anyone help me with this?

Most helpful comment

Resolved by changing the filter size prior to [yolo] according to the number of classes in the config file

>All comments

Resolved by changing the filter size prior to [yolo] according to the number of classes in the config file

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hezhangubc picture hezhangubc  路  4Comments

mwharton3 picture mwharton3  路  3Comments

alexandru-dinu picture alexandru-dinu  路  3Comments

qianwangn picture qianwangn  路  3Comments

impravin22 picture impravin22  路  4Comments