Giter Club home page Giter Club logo

simclrv2-pytorch's Introduction

Fork of SimCLRv2-Pytorch

This fork adds support for ResNet18 models conversion to PyTorch. It also adds TF & PyTorch converted checkpoints with SimCLR models pretrained on CIFAR10 and CIFAR100.

The implementation was tested as follows:

  • CIFAR10 & CIFAR100 SimCLR models were trained using the code & commands provided in the Google's simclr repo as of this commit;
  • Only unsupervised pretraining phase was executed; no linear head fine-tuning was performed;
  • The last checkpoint was converted to PyTorch (see convert_resnet18.ipynb);
  • The converted models were loaded into PyTorch, all layers apart from the last block and an FC head were frozen, and using supervised fine-tuning I was able to achieve 95% and 74.4% validation accuracy on CIFAR10 and CIFAR100 respectively;
  • The weights of pretrained backbones (ignore FC weights) can be found in cifar10-ckpts and cifar100-ckpts folders;
  • Note: I cannot guarantee that the code in this repository still works with ResNet50/101, I didn't test it after my modifications.

Original ReadMe content (below)

Pretrained SimCLRv2 models in Pytorch.

python download.py r152_3x_sk1
python convert.py r152_3x_sk1/model.ckpt-250228 [--ema]
python verify.py r152_3x_sk1.pth
Model Pytorch TF
r50_1x_sk0 70.97 71.7
r50_1x_sk1 73.79 74.6
r152_3x_sk1 79.12 79.8

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.