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?
Resolved by changing the filter size prior to [yolo] according to the number of classes in the config file
Most helpful comment
Resolved by changing the filter size prior to [yolo] according to the number of classes in the config file