Patch-Mix Transformer for Unsupervised Domain Adaptation: A Game Perspective
There are some typos in results on the DomainNet dataset. And we revise these typos in the newest version. Please check it.
This is a rough version, I will continue to polish it.
- Download swin_base_patch4_window7_224_22k.pth and put it into
pretrained_models
- Create a conda virtual environment and activate it:
conda create -n swin python=3.7 -y
conda activate swin
- Install
CUDA==10.1
withcudnn7
following the official installation instructions - Install
PyTorch==1.7.1
andtorchvision==0.8.2
withCUDA==10.1
:
conda install pytorch==1.7.1 torchvision==0.8.2 cudatoolkit=10.1 -c pytorch
- Install
timm==0.3.2
:
pip install timm==0.3.2
pip install tensorboard
- Install
Apex
:
git clone https://github.com/NVIDIA/apex
cd apex
pip install -v --disable-pip-version-check --no-cache-dir ./
https://github.com/NVIDIA/apex/issues/1227
- Install other requirements:
pip install opencv-python==4.4.0.46 termcolor==1.1.0 yacs==0.1.8
- Download the
Office31, Office Home, VisDA and Domainnet
Make a file recording the path and label of image like txt files indatasets/office_home/
$ tree data
datasets
├── ofice_home
│ ├── Art.txt
│ ├── Clipart.txt
│ ├── Product.txt
│ ├── Real_World.txt
└── ...
bash dist_train.sh