yolact
yolact copied to clipboard
cant load model after custom training
Hi, I trained yolact_base with a custom dataset with only 1 object. I have retrieved weights but I am unable to load it back to use it in inference.
Traceback (most recent call last):
File "/home/ros_ws/install/halodi_segmentation/lib/halodi_segmentation/halodi_segmentation", line 11, in <module>
load_entry_point('halodi-segmentation', 'console_scripts', 'halodi_segmentation')()
File "/home/ros_ws/build/halodi_segmentation/halodi_segmentation/segmentation_node.py", line 296, in main
node = SegmentationNode()
File "/home/ros_ws/build/halodi_segmentation/halodi_segmentation/segmentation_node.py", line 85, in __init__
self.segmentator = Segmentor(self.parameters)
File "/home/ros_ws/build/halodi_segmentation/halodi_segmentation/segmentor.py", line 26, in __init__
self.setup_cfg(parameters)
File "/home/ros_ws/build/halodi_segmentation/halodi_segmentation/segmentor.py", line 41, in setup_cfg
self.predictor.load_weights(args[-1][1])
File "/home/ros_ws/src/halodi_segmentation/halodi_segmentation/models/yolact/yolact.py", line 490, in load_weights
self.load_state_dict(state_dict)
File "/home/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1497, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format
RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for Yolact:
size mismatch for prediction_layers.0.conf_layer.weight: copying a param with shape torch.Size([18, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([243, 256, 3, 3]).
size mismatch for prediction_layers.0.conf_layer.bias: copying a param with shape torch.Size([18]) from checkpoint, the shape in current model is torch.Size([243]).
size mismatch for semantic_seg_conv.weight: copying a param with shape torch.Size([5, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([80, 256, 1, 1]).
size mismatch for semantic_seg_conv.bias: copying a param with shape torch.Size([5]) from checkpoint, the shape in current model is torch.Size([80])