Giter VIP home page Giter VIP logo

vssl-tl-kt's Introduction

VISSL_tools

Train a custom dataset on a single GPU

  1. Copy config files to configs/config/my/
  2. Download pretrained weights from the VISSL repo to pretrain_models/
  3. Set the dataset paths on configs/config/dataset_catalog.json
  4. Train SimCLR-resnet50 with pretrained weights:
python tools/run_distributed_engines.py hydra.verbose=true config.HOOKS.TENSORBOARD_SETUP.USE_TENSORBOARD=true config.HOOKS.MEMORY_SUMMARY.PRINT_MEMORY_SUMMARY=false config=pretrain/simclr/simclr_8node_resnet config.CHECKPOINT.DIR=/save/train/path config.DATA.TRAIN.DATASET_NAMES=[dataset_name] config.DATA.TEST.DATASET_NAMES=[dataset_name] config.DISTRIBUTED.NUM_NODES=1 config.DISTRIBUTED.NUM_PROC_PER_NODE=1 config.DISTRIBUTED.RUN_ID=auto config.MODEL.WEIGHTS_INIT.PARAMS_FILE=pretrain_models/resnet50-19c8e357.pth config.MODEL.WEIGHTS_INIT.APPEND_PREFIX="trunk._feature_blocks." config.MODEL.WEIGHTS_INIT.STATE_DICT_KEY_NAME=""
  1. Extract features
python tools/run_distributed_engines.py config=my/resnet_feature_extraction config.MODEL.WEIGHTS_INIT.PARAMS_FILE=/save/train/path/checkpoint.torch config.EXTRACT_FEATURES.OUTPUT_DIR=/features/out/path config.DATA.TRAIN.DATASET_NAMES=[dataset_name] config.DATA.TEST.DATASET_NAMES=[dataset_name]
  1. Visualize features
python features_plot.py /path/to/features --scale --tsne --title a_tile -o tsne.png
  1. Train classifier
  • Set num classes on the config file simclr_resnet_transfer_linear_single_head.yaml
python tools/run_distributed_engines.py hydra.verbose=true config.HOOKS.TENSORBOARD_SETUP.USE_TENSORBOARD=true config.HOOKS.MEMORY_SUMMARY.PRINT_MEMORY_SUMMARY=false config=my/simclr_resnet_transfer_linear_single_head config.CHECKPOINT.DIR=/save/train/path/ config.DATA.TRAIN.DATASET_NAMES=[dataset_name] config.DATA.TEST.DATASET_NAMES=[dataset_name] config.MODEL.WEIGHTS_INIT.PARAMS_FILE=/previous/simclr/train/path/checkpoint.torch
  1. Extract features of the classifier model
python tools/run_distributed_engines.py config=my/simclr_resnet_transfer_linear_single_head_feature_extraction config.MODEL.WEIGHTS_INIT.PARAMS_FILE=/train/path/checkpoint.torch config.EXTRACT_FEATURES.OUTPUT_DIR=/features/out/path config.DATA.TRAIN.DATASET_NAMES=[dataset_name] config.DATA.TEST.DATASET_NAMES=[dataset_name]
  1. Evaluate the classified features
python cls_evaluation.py /path/to/classified/features -l res5 -s test --title a_tile -o /output/evaluation --label-map /save/train/path/test_label_to_index_map.json

vssl-tl-kt's People

Contributors

edgargracia avatar

Watchers

Thonifho Muhali avatar

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.