datvuthanh / HybridNets

HybridNets: End-to-End Perception Network
MIT License
570 stars 117 forks source link

I got errors when running hybridnets_test_videos.py after training with multiclass. #96

Open L1NINE opened 8 months ago

L1NINE commented 8 months ago

(yolov5) D:\HybridNets-main2>python hybridnets_test.py -w checkpoints/PEOPLE/hybridnets-d3_0_35000.pth --source demo/image --output demo_result --imshow False --imwrite True FOUND 6 IMAGES DETECTED SEGMENTATION MODE FROM WEIGHT AND PROJECT FILE: multiclass Traceback (most recent call last): File "hybridnets_test.py", line 127, in model.load_state_dict(weight) File "F:\yolov5\Miniconda\envs\yolov5\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 HybridNetsBackbone: size mismatch for classifier.header.pointwise_conv.conv.weight: copying a param with shape torch.Size([45, 160, 1, 1]) from checkpoint, the shape in current model is torch.Size([9, 160, 1, 1]). size mismatch for classifier.header.pointwise_conv.conv.bias: copying a param with shape torch.Size([45]) from checkpoint, the shape in current model is torch.Size([9]).

My friends got the same errors. Help me plz TT

L1NINE commented 8 months ago

I have resolved this error. The question came from my project.yml.