Run B_ Yolov4 an error is reported when calculating the map:
RuntimeError: Error(s) in loading state_dict for YoloBody:
size mismatch for yolo_head3.1.weight: copying a param with shape torch.Size([75, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([255, 256, 1, 1]).
size mismatch for yolo_head3.1.bias: copying a param with shape torch.Size([75]) from checkpoint, the shape in current model is torch.Size([255]).
size mismatch for yolo_head2.1.weight: copying a param with shape torch.Size([75, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([255, 512, 1, 1]).
size mismatch for yolo_head2.1.bias: copying a param with shape torch.Size([75]) from checkpoint, the shape in current model is torch.Size([255]).
size mismatch for yolo_head1.1.weight: copying a param with shape torch.Size([75, 1024, 1, 1]) from checkpoint, the shape in current model is torch.Size([255, 1024, 1, 1]).
size mismatch for yolo_head1.1.bias: copying a param with shape torch.Size([75]) from checkpoint, the shape in current model is torch.Size([255]).
resolvent:
Check class in train.py_ Names and num_ The classes are all right, so it is determined that it is a problem in several programs called when calculating map. Finally, it is found that the number of classes in yolo.py is wrong,
"classes_path" : 'model_data/coco_classes.txt',
Replace with:
"classes_path" : 'model_data/voc_classes.txt',
ginseng https://github.com/bubbliiiing/yolo3-pytorch/issues/17
https://blog.csdn.net/nangg1047/article/details/116073131
Read More:
- pytorch raise RuntimeError(‘Error(s) in loading state_dict for {}:\n\t{}‘.format
- Pytorch RuntimeError: Error(s) in loading state_ dict for Dat aParallel:.. function submit.py Solutions for reporting errors
- RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the
- Copying a param with shape torch. Size ([262, 2048]), parameter size does not match
- Build your own resnet18 network and load torch vision’s own weight
- ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 256,
- Error using ones Size inputs must be integers. Error in testdisplay1 (line 38) array=-ones(buf+m*(s
- RuntimeError: Expected hidden[0] size (x, x, x), got(x, x, x)
- Error in creating index by Google elasticsearch head plug-in
- valueError: Length mismatch: Expected axis has 40 elements, new values have 38 elements
- Bad default revision ‘head’
- Get connection timeout retry: 1 MySQL errorcode 0, state 08s01 docker container accessing MySQL container is very slow and sometimes interrupted
- RuntimeError: each element in
- raise ValueError(‘Expected input batch_size ({}) to match target batch_size ({}).‘
- NVIDIA NVML Driver/library version mismatch
- Error in tensorflow loading model valueerror: unknown layer: functional
- error: cannot open .git/FETCH_ Head: permission denied resolved