Skip to content

Commit

Permalink
update code for the latest timm
Browse files Browse the repository at this point in the history
  • Loading branch information
HubHop committed Oct 13, 2022
1 parent 646024f commit cc7a2f9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ figures/*
plots/*
.idea/*
checkpoints/
output/*
*.out
*.err
.vscode/
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ By [Zizheng Pan](https://scholar.google.com.au/citations?user=w_VMopoAAAAJ&hl=en

## News

- **13/10/2022.** Fix compatibility with higher version of timm.

- **30/09/2022.** Add [benchmarking results](https://github.com/ziplab/LITv2#single-attention-layer-benchmark) for single attention layer. HiLo is super fast on both CPU and GPU!

- **15/09/2022.** LITv2 is accepted by NeurIPS 2022! 🔥🔥🔥
Expand Down Expand Up @@ -55,7 +57,8 @@ torch.Size([64, 196, 384])
### Requirements

- Linux with Python ≥ 3.6
- PyTorch 1.8.1
- PyTorch >= 1.8.1
- timm >= 0.3.2
- CUDA 11.1
- An NVIDIA GPU

Expand All @@ -70,7 +73,7 @@ conda activate lit
# Install Pytorch and TorchVision
pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html

pip install timm==0.3.2
pip install timm
pip install ninja
pip install tensorboard

Expand Down
5 changes: 4 additions & 1 deletion classification/data/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
from timm.data.constants import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
from timm.data import Mixup
from timm.data import create_transform
from timm.data.transforms import _pil_interp
try:
from timm.data.transforms import _pil_interp
except:
from timm.data.transforms import str_to_pil_interp as _pil_interp

from .cached_image_folder import CachedImageFolder
from .samplers import SubsetRandomSampler
Expand Down
2 changes: 1 addition & 1 deletion classification/lr_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def build_scheduler(config, optimizer, n_iter_per_epoch):
lr_scheduler = CosineLRScheduler(
optimizer,
t_initial=num_steps,
t_mul=1.,
# t_mul=1.,
lr_min=config.TRAIN.MIN_LR,
warmup_lr_init=config.TRAIN.WARMUP_LR,
warmup_t=warmup_steps,
Expand Down

0 comments on commit cc7a2f9

Please sign in to comment.