apple / ml-cvnets

CVNets: A library for training computer vision networks
https://apple.github.io/ml-cvnets
Other
1.76k stars 225 forks source link

Training SSDLite-MobileViTv2-2.0 object detection model #75

Closed MLRadfys closed 1 year ago

MLRadfys commented 1 year ago

Hi,

Iam trying to train the SSDLite-MobileViT object detection model on the Coco dataset. According to the documentation, model training is started using the following command:

PYTHONWARNINGS="ignore" cvnets-train --common.config-file config/detection/ssd_coco/mobilevit_v2.yaml --common.results-loc ssdlite_mobilevitv2_results/width_2_0_0 --common.override-kwargs model.classification.mitv2.width_multiplier=2.0 model.classification.pretrained="LOCATION_OF_IMAGENET_1k_CHECKPOINT"

Now Iam wondering where I can find the imagenert weights?

I found pretrained weights in the model zoo readme (https://github.com/apple/ml-cvnets/blob/main/docs/source/en/general/README-model-zoo.md) but when I try to load them I get the following error:

_Unable to load pretrained weights from pretrained_models/detection/coco-ssd-mobilevitv2-2.0.pt. Error: Error(s) in loading state_dict for MobileViTv2: Missing key(s) in state_dict: "conv_1.block.conv.weight", "conv_1.block.norm.weight", "conv_1.block.norm.bias", "conv_1.block.norm.running_mean", "conv_1.block.norm.running_var", "layer_1.0.block.exp1x1.block.conv.weight",...

Thanks in advance,

kind regards,

M

MLRadfys commented 1 year ago

I got it,

simply used the wrong weights. Sorry for the misunderstanding...

/M