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
Here is my code using DINO as a feature extractor
` dinov2_weights = torch.hub.load_state_dict_from_url("https://dl.fbaipublicfiles.com/dinov2/dinov2_vitl14/dinov2_vitl14_pretrain.pth", map_location="cpu")
vit_kwargs = dict(img_size=518,
patch_size= 14,
init_values = 1.0,
ffn_layer = "mlp",
block_chunks = 0,
)
dinov2_vitl14 = vit_large(**vit_kwargs).eval()
dinov2_vitl14.load_state_dict(dinov2_weights)`
The error message is displayed: assert H % patch_H == 0, f"Input image height {H} is not a multiple of patch height {patch_H}" AssertionError: Input image height 320 is not a multiple of patch height 14
I entered the size of the image as [320,736]. When I set the patch_size to 16, the loaded checkpoint does not match. My aim is to perform feature extraction on image of size [320,736]. How should I load the pre-training weights? Is there any other way to solve my problem?
The text was updated successfully, but these errors were encountered:
DinoV2 has been trained with a patch size of 14, is not possible to load a model with a different patch size, unless you train it by scratch, for that reason your image size should also be a multiple of 14.
DinoV2 has been trained with a patch size of 14, is not possible to load a model with a different patch size, unless you train it by scratch, for that reason your image size should also be a multiple of 14.
The error message is displayed:
assert H % patch_H == 0, f"Input image height {H} is not a multiple of patch height {patch_H}" AssertionError: Input image height 320 is not a multiple of patch height 14
The text was updated successfully, but these errors were encountered: