You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello amaralibey,
First of all, thank you for the fantastic work and paper.
There was an error after the recent updates when loading the model using this line: vpr_model = torch.hub.load("amaralibey/bag-of-queries", "get_trained_boq", backbone_name="dinov2", output_dim=12288)
The error: RuntimeError: Error(s) in loading state_dict for VPRModel: Unexpected key(s) in state_dict: "backbone.dino.norm.weight", "backbone.dino.norm.bias".
Editing vpr_model.load_state_dict to add 'strict=False' seems to fix it: vpr_model.load_state_dict( torch.hub.load_state_dict_from_url( MODEL_URLS[f"{backbone_name}_{output_dim}"], map_location=torch.device('cpu') ), strict=False ) return vpr_model
The text was updated successfully, but these errors were encountered:
Thank you for your interest and for reporting this issue :)
I am editing the entire code base to add training code and dataset download scripts.
The error is due to an update where I forgot to remove the norm layer of the DINOv2 backbone, which isn't used in BoQ. My apologies for the oversight.
I'm currently fixing this issue, so it should be resolved very soon. In the meantime, your workaround with strict=False is indeed a valid solution and will allow the model to function as expected.
Thanks again for your patience, and feel free to reach out if you encounter any other issues!
Hello amaralibey,
First of all, thank you for the fantastic work and paper.
There was an error after the recent updates when loading the model using this line:
vpr_model = torch.hub.load("amaralibey/bag-of-queries", "get_trained_boq", backbone_name="dinov2", output_dim=12288)
The error:
RuntimeError: Error(s) in loading state_dict for VPRModel: Unexpected key(s) in state_dict: "backbone.dino.norm.weight", "backbone.dino.norm.bias".
Editing vpr_model.load_state_dict to add 'strict=False' seems to fix it:
vpr_model.load_state_dict( torch.hub.load_state_dict_from_url( MODEL_URLS[f"{backbone_name}_{output_dim}"], map_location=torch.device('cpu') ), strict=False ) return vpr_model
The text was updated successfully, but these errors were encountered: