Coder Social home page Coder Social logo

dapn's Introduction

Introduction

The framework is implemented and tested with Ubuntu 16.04, CUDA 8.0/9.0, Python 3, Pytorch 0.4/1.0/1.1, NVIDIA TITANX GPU.

Requirements

  • Cuda & Cudnn & Python & Pytorch

    This project is tested with CUDA 8.0/9.0, Python 3, Pytorch 0.4/1.0, NVIDIA TITANX GPUs.

    Please install proper CUDA and CUDNN version, and then install Anaconda3 and Pytorch. Almost all the packages we use are covered by Anaconda.

  • My settings

    source ~/anaconda3/bin/activate (python 3.6.5)
      (base)  pip list
      torch                              0.4.1
      torchvision                        0.2.2.post3
      numpy                              1.18.1
      numpydoc                           0.8.0
      numba                              0.42.0
      opencv-python                      4.0.0.21

Data preparation

Download and unzip the datasets: MiniImageNet, TieredImageNet, DomainNet.

Here we provide the datasets of target domain in Google Drive, miniImageNet, tieredImageNet.

Format: (E.g. mini-imagenet)

MINI_DIR/
  --  train/
      --  n01532829/
      --  n01558993/
      ...
  --  train_new_domain/
  --  val/
  --  val_new_domain/
  --  test/
  --  test_new_domain/

Training

First set the dataset path MINI_DIR/, TIERED_DIR/, DOMAIN_DIR/ for the three datasets.

For each dataset, we use its training set to train a pre-trained model (e.g. tiered-imagenet).

cd pretrain/
python -u main_resnet.py --epochs 50 --batch_size 1024  --dir_path TIERED_DIR 2>&1 | tee log.txt &

We then use the corresponding pre-trained model to train on each dataset. (e.g. mini-imagenet)

python -u train_cross.py --gpu_id 0 --net ResNet50 --dset mini-imagenet --s_dset_path MINI_DIR --fsl_test_path MINI_DIR --shot 5 --train-way 16 --pretrained 'mini_checkpoint.pth.tar' --output_dir mini_way_16

Testing

python -u test.py --load MODEL_PATH --root MINI_DIR

dapn's People

Contributors

dingmyu 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.