Parskatt / DKM

[CVPR 2023] DKM: Dense Kernelized Feature Matching for Geometry Estimation
https://parskatt.github.io/DKM/
Other
378 stars 28 forks source link

The issues encountered during training the network. #51

Open stilcrad opened 5 months ago

stilcrad commented 5 months ago

It's a great work!!! But I met some problem, when I ran your training code, the weights named "train_DKMv3_outdoor_latest.pth" was 852MB. However, the model you provided with the training code is only 258MB. I can successfully run the provided model, but I encounter errors when using my own trained model. Where is the problem and how can I obtain a trained model of the same size that is able to run properly like the one you provided?

    raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for RegressionMatcher:
Missing key(s) in state_dict: "encoder.net.conv1.weight", "encoder.net.bn1.weight", "encoder.net.bn1.bias", "encoder.net.bn1.running_mean", "encoder.net.bn1.running_var", "encoder.net.layer1.0.conv1.weight",
encoder.net.layer1.0.bn1.weight", "encoder.net.layer1.0.bn1.bias", "encoder.net.layer1.0.bn1.running_mean", "encoder.net.layer1.0.bn1.running_var", "encoder.net.layer1.0.conv2.weight", "encoder.net.layer1.0.bn2.weight", 
......

.conv_refiner.1.disp_emb.weight", "decoder.conv_refiner.1.disp_emb.bias". 
    Unexpected key(s) in state_dict: "model", "n", "optimizer", "lr_scheduler". 
Parskatt commented 5 months ago

The provided model is only the model weights. Your trained model includes optimizer, etc. To get only model, use 'model' key.