deep-learning-for-image-processing icon indicating copy to clipboard operation
deep-learning-for-image-processing copied to clipboard

运行SSD predict_test.py 出现出现错误

Open woshidamow5534 opened this issue 1 year ago • 0 comments

Traceback (most recent call last): File "F:\yolov8_change\deep-learning-for-image-processing-master\pytorch_object_detection\ssd\predict_test.py", line 98, in main() File "F:\yolov8_change\deep-learning-for-image-processing-master\pytorch_object_detection\ssd\predict_test.py", line 40, in main model.load_state_dict(weights_dict,strict=False) File "F:\DL\anaconda\anaconda3\Lib\site-packages\torch\nn\modules\module.py", line 2041, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for SSD300: size mismatch for conf.0.weight: copying a param with shape torch.Size([36, 1024, 3, 3]) from checkpoint, the shape in current model is torch.Size([84, 1024, 3, 3]). size mismatch for conf.0.bias: copying a param with shape torch.Size([36]) from checkpoint, the shape in current model is torch.Size([84]). size mismatch for conf.1.weight: copying a param with shape torch.Size([54, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([126, 512, 3, 3]). size mismatch for conf.1.bias: copying a param with shape torch.Size([54]) from checkpoint, the shape in current model is torch.Size([126]). size mismatch for conf.2.weight: copying a param with shape torch.Size([54, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([126, 512, 3, 3]). size mismatch for conf.2.bias: copying a param with shape torch.Size([54]) from checkpoint, the shape in current model is torch.Size([126]). size mismatch for conf.3.weight: copying a param with shape torch.Size([54, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([126, 256, 3, 3]). size mismatch for conf.3.bias: copying a param with shape torch.Size([54]) from checkpoint, the shape in current model is torch.Size([126]). size mismatch for conf.4.weight: copying a param with shape torch.Size([36, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([84, 256, 3, 3]). size mismatch for conf.4.bias: copying a param with shape torch.Size([36]) from checkpoint, the shape in current model is torch.Size([84]). size mismatch for conf.5.weight: copying a param with shape torch.Size([36, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([84, 256, 3, 3]). size mismatch for conf.5.bias: copying a param with shape torch.Size([36]) from checkpoint, the shape in current model is torch.Size([84]).

woshidamow5534 avatar Oct 08 '24 05:10 woshidamow5534