Skip to content

How to use the pretrained SimCLR model to extract image features. #398

Answered by ananyahjha93
hosea7456 asked this question in Q&A
Discussion options

You must be logged in to vote

@hosea7456 we are in the process of updating simclr weights for cifar-10 and Imagenet. Also, to use the simclr pretrained weights, you can refer to the docs: https://pytorch-lightning-bolts.readthedocs.io/en/latest/self_supervised_models.html#simclr

The code below just defines the usage pattern. It needs to be updated with the latest trained weights.

from pl_bolts.models.self_supervised import SimCLR

weight_path = 'https://pl-bolts-weights.s3.us-east-2.amazonaws.com/simclr/simclr-cifar10-v1-exp12_87_52/epoch%3D960.ckpt'
simclr = SimCLR.load_from_checkpoint(weight_path, strict=False)

simclr.freeze()

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@motoight
Comment options

@ananyahjha93
Comment options

@motoight
Comment options

Answer selected by Borda
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #398 on December 08, 2020 19:20.