New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
intermediate tokens #398
Comments
hi, do you find a solution? |
x = torch.rand((1, 3, 224, 224))
dinov2 = torch.hub.load('facebookresearch/dinov2', 'dinov2_vits14_reg')
features = dinov2.forward_features(x)
['x_norm_clstoken', 'x_norm_regtokens', 'x_norm_patchtokens', 'x_prenorm', 'masks'] |
x = torch.rand(1, 3, 224, 224) See also get_intermediate_layers function in dinov2/models/vision_transformer.py |
get_intermediate_layers is indeed what you need ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I have got the mdoel using : 'dinov2_vitl14 = torch.hub.load('facebookresearch/dinov2', 'dinov2_vitl14')'.
And how can I get the output tokens of specific intermediate layers when inferencing.
The text was updated successfully, but these errors were encountered: