mrT23 / TResNet

TOP 1 ACCURACY TOP 5 ACCURACY
SPEED
MODEL CODE PAPER
ε-REPR
CODE PAPER
ε-REPR
PAPER
GLOBAL RANK
TResNet-L-V2-FP16
81.9% 81.9% 95.4% 95.1% 839.9 #79
TResNet-M-FP16
80.7% 80.7% 94.8% 94.8% 630.7 #117
See Full Build Details +get badge code
[![SotaBench](https://img.shields.io/endpoint.svg?url=https://sotabench.com/api/v0/badge/gh/hussam789/TResNet)](https://sotabench.com/user/hussam.lawen/repos/hussam789/TResNet)

How the Repository is Evaluated

The full sotabench.py file - source
import gc

from torchbench.image_classification import ImageNet
import urllib.request
import torch
from torchvision.transforms import transforms
from src.helper_functions.helper_functions import validate, create_dataloader, create_val_tfm, \
    upload_data_to_gpu
from src.models import create_model
import argparse

from src.models.tresnet.tresnet import InplacABN_to_ABN
from src.models.utils.fuse_bn import fuse_bn_recursively
from src.models.tresnet.layers.avg_pool import TestTimePoolHead

parser = argparse.ArgumentParser(description='PyTorch TResNet ImageNet Inference')
parser.add_argument('--val_dir')
parser.add_argument('--model_path')
parser.add_argument('--model_name', type=str, default='tresnet_m')
parser.add_argument('--num_classes', type=int, default=1000)
parser.add_argument('--input_size', type=int, default=224)
parser.add_argument('--val_zoom_factor', type=int, default=0.875)
parser.add_argument('--batch_size', type=int, default=48)
parser.add_argument('--num_workers', type=int, default=8)

# parsing args
args = parser.parse_args()
val_tfms = create_val_tfm(args)

#### TResNet-M ####
args.model_name = 'tresnet_m'
model_path = './tresnet_m.pth'
model = create_model(args)
state = torch.load(model_path, map_location='cpu')['model']
model.load_state_dict(state, strict=True)
model = InplacABN_to_ABN(model)
model = fuse_bn_recursively(model)
model = model.cuda()
model = model.half()
model.eval()

# Run the benchmark
print('Benchmarking TResNet-M')
for i in range(1):  # Two times for caching
    ImageNet.benchmark(
        model=model,
        paper_model_name='TResNet-M-FP16',
        paper_arxiv_id='2003.13630',
        input_transform=val_tfms,
        batch_size=640,
        num_workers=args.num_workers,
        num_gpu=1,
        pin_memory=True,
        paper_results={'Top 1 Accuracy': 0.807, 'Top 5 Accuracy': 0.948},
        model_description="Official weights from the author's of the paper.",
        send_data_to_device=upload_data_to_gpu
    )

del model
gc.collect()
torch.cuda.empty_cache()

# #### TResNet-L-2 ####
args.model_name = 'tresnet_l_v2'
model_path = './tresnet_l_2.pth'
model = create_model(args)
state = torch.load(model_path, map_location='cpu')['model']
model.load_state_dict(state, strict=True)
model = InplacABN_to_ABN(model)
model = fuse_bn_recursively(model)
model = model.cuda()
model = model.half()
model.eval()

# Run the benchmark
print('Benchmarking TResNet-L-V2-FP16 ')
for i in range(1):  # Two times for caching
    ImageNet.benchmark(
        model=model,
        paper_model_name='TResNet-L-V2-FP16',
        paper_arxiv_id='2003.13630',
        input_transform=val_tfms,
        batch_size=600,
        num_workers=args.num_workers,
        num_gpu=1,
        pin_memory=True,
        paper_results={'Top 1 Accuracy': 0.819, 'Top 5 Accuracy': 0.951},
        model_description="TResNet-L-V2.",
        send_data_to_device=upload_data_to_gpu,
    )

del model
gc.collect()
torch.cuda.empty_cache()

#### TResNet-M ####
args.model_name = 'tresnet_m'
model_path = './tresnet_m.pth'
model = create_model(args)
state = torch.load(model_path, map_location='cpu')['model']
model.load_state_dict(state, strict=True)
model = InplacABN_to_ABN(model)
model = fuse_bn_recursively(model)
model = model.cuda()
model = model.half()
model.eval()

print('Benchmarking TResNet-M')
for i in range(1):  # Two times for caching
    ImageNet.benchmark(
        model=model,
        paper_model_name='TResNet-M-FP16',
        paper_arxiv_id='2003.13630',
        input_transform=val_tfms,
        batch_size=640,
        num_workers=args.num_workers,
        num_gpu=1,
        pin_memory=True,
        paper_results={'Top 1 Accuracy': 0.807, 'Top 5 Accuracy': 0.948},
        model_description="Official weights from the author's of the paper.",
        send_data_to_device=upload_data_to_gpu
    )

del model
gc.collect()
torch.cuda.empty_cache()
STATUS
BUILD
COMMIT MESSAGE
RUN TIME
m
mrT23   741c392  ·  Oct 11 2020
0h:41m:13s
try3
mrT23   2b65b7e  ·  Oct 11 2020
0h:37m:43s
batch_size=640
mrT23   4dc13ba  ·  Oct 11 2020
0h:40m:29s
Update sotabench.py
mrT23   fec5b6c  ·  Oct 10 2020
0h:39m:11s
sotabench run
mrT23   ca1dff9  ·  Oct 10 2020
0h:40m:17s
device
mrT23   9dbde99  ·  Oct 10 2020
0h:38m:54s
Update sotabench.py send_data_to_device=upload_data_to_gpu
mrT23   3fe977e  ·  Oct 10 2020
0h:37m:34s
model = model.half()
mrT23   4019233  ·  Oct 10 2020
0h:38m:47s
Merge branch 'master' of https://github.com/hussam789/TResNet
mrT23 cd672ff    b5b820f  ·  Aug 29 2020
0h:34m:54s
280
mrT23   97d71d6  ·  Aug 29 2020
0h:33m:52s
simd try2
mrT23   021a694  ·  Aug 29 2020
0h:40m:38s
apt-get update
mrT23   2b4f876  ·  Aug 29 2020
0h:28m:25s
apt-get
mrT23   86442c8  ·  Aug 29 2020
0h:23m:29s
simd2
mrT23   504531e  ·  Aug 29 2020
0h:30m:40s
simd
mrT23   4b080fa  ·  Aug 29 2020
0h:34m:02s
300
mrT23   9f822fd  ·  Aug 28 2020
0h:25m:23s
batch_size=250,
mrT23   be82fa1  ·  Aug 28 2020
0h:27m:03s
apt-get install wget
mrT23   9a194b4  ·  Aug 28 2020
0h:29m:33s
-P ./.data/vision/imagenet
mrT23   2840660  ·  Aug 28 2020
0h:12m:11s
data_root='./',
mrT23   465b89a  ·  Aug 28 2020
0h:08m:55s
download imagenet try1
mrT23   6ce49f5  ·  Aug 28 2020
0h:10m:33s
Update sotabench_setup.sh
mrT23   5d36017  ·  Aug 27 2020
0h:10m:07s
Update requirements.txt torch==1.4.0 torchvision==0.5.0
mrT23   217ddae  ·  Aug 26 2020
0h:05m:19s
Update sotabench_setup.sh torchvision==0.5.0
mrT23   2e56c90  ·  Aug 26 2020
0h:06m:34s
Update sotabench_setup.sh pip install torch==1.4.0
mrT23   84ce1e2  ·  Aug 26 2020
0h:11m:08s
Update sotabench_setup.sh rebuild try2
mrT23   bbd1c0e  ·  Aug 26 2020
0h:03m:30s
Update sotabench_setup.sh
hussam789   4342488  ·  Aug 26 2020
0h:05m:37s
Update requirements.txt no torch in req
mrT23   69b1e45  ·  Aug 26 2020
0h:04m:52s
Update sotabench_setup.sh pip install torch==1.3.0
mrT23   df28343  ·  Aug 26 2020
0h:06m:01s
Update sotabench_setup.sh pip install torch=1.3.0
mrT23   ff7f9f7  ·  Aug 26 2020
0h:04m:21s
Update sotabench_setup.sh pytorch 1.5
mrT23   cc000a2  ·  Aug 26 2020
0h:10m:22s
Update sotabench_setup.sh
mrT23   e5eff74  ·  Aug 26 2020
0h:10m:44s
Update sotabench_setup.sh no simd
mrT23   6479fee  ·  Aug 26 2020
0h:05m:20s
Update sotabench_setup.sh
mrT23   f4febf3  ·  Aug 26 2020
0h:09m:41s
Update sotabench_setup.sh
hussam789   bf93cd2  ·  Aug 24 2020
0h:06m:45s
no simd
mrT23   66d559c  ·  Aug 21 2020
unknown
sharing
mrT23   251be81  ·  Aug 21 2020
unknown
Merge branch 'master' of https://github.com/hussam789/TResNet
mrT23 5f07ab2    bd73660  ·  Aug 21 2020
4 days, 5h:24m:48s
Update sotabench.py
hussam789   cd22582  ·  Apr 03 2020
0h:17m:48s
Update sotabench.py
hussam789   003f23a  ·  Apr 02 2020
0h:21m:02s
Update sotabench.py
hussam789   c966a28  ·  Apr 02 2020
0h:35m:21s
Update sotabench.py
hussam789   4beda16  ·  Apr 02 2020
0h:14m:55s
Update sotabench.py
hussam789   d970307  ·  Apr 02 2020
0h:18m:10s
0h:14m:14s
Update sotabench.py
hussam789   ffbf639  ·  Apr 02 2020
0h:16m:38s
Update sotabench.py
hussam789   99ac024  ·  Apr 02 2020
0h:17m:38s
Update sotabench.py
hussam789   a72ab64  ·  Apr 02 2020
0h:06m:14s
Update sotabench.py
hussam789   ecb6bd1  ·  Apr 02 2020
0h:00m:41s
Update sotabench.py
hussam789   5458429  ·  Apr 02 2020
0h:19m:20s
Update sotabench.py
hussam789   894f4b4  ·  Apr 02 2020
0h:12m:55s
Update sotabench.py
hussam789   4fd69e8  ·  Apr 02 2020
0h:07m:05s
Update sotabench.py
hussam789   e8c6467  ·  Apr 02 2020
0h:11m:25s
Update sotabench_setup.sh
hussam789   8c24059  ·  Apr 02 2020
0h:25m:42s
Update sotabench.py
hussam789   a051df8  ·  Apr 02 2020
0h:03m:27s
Update sotabench.py
hussam789   3faeffc  ·  Apr 02 2020
0h:10m:37s
Update avg_pool.py
hussam789   334f339  ·  Apr 02 2020
0h:17m:52s
Update sotabench.py
hussam789   8a7cbff  ·  Apr 02 2020
0h:00m:50s
Update avg_pool.py
hussam789   a9f2888  ·  Apr 02 2020
0h:05m:48s
Update sotabench.py
hussam789   c3d1190  ·  Apr 02 2020
0h:08m:09s
Update avg_pool.py
hussam789   e0ebbbe  ·  Apr 02 2020
0h:05m:56s
Update sotabench.py
hussam789   60c4318  ·  Apr 02 2020
0h:05m:44s
Update tresnet.py
hussam789   ffc57d6  ·  Apr 02 2020
0h:07m:46s
Update avg_pool.py
hussam789   f91b23b  ·  Apr 02 2020
0h:00m:44s
Update sotabench.py
hussam789   0321b36  ·  Apr 02 2020
0h:10m:29s
Update sotabench.py
hussam789   f8e3d69  ·  Apr 02 2020
0h:03m:10s
TestTimePoolHead
hussam789   763950c  ·  Apr 02 2020
0h:01m:43s
Update sotabench.py
hussam789   0d2cd71  ·  Apr 02 2020
0h:17m:21s
464, 250, 250, 125
hussam789   8beb6d4  ·  Apr 02 2020
0h:15m:50s
432, 288, 288, 180
hussam789   838e463  ·  Apr 02 2020
0h:09m:31s
Update sotabench.py
hussam789   094bc13  ·  Apr 02 2020
0h:12m:46s
Update sotabench.py
hussam789   62cd3d6  ·  Apr 02 2020
0h:15m:01s
Update sotabench.py
hussam789   ddb1261  ·  Apr 01 2020
0h:14m:18s
bs=250
hussam789   ac3dd08  ·  Apr 01 2020
0h:13m:59s
Update sotabench.py
hussam789   f1b03ff  ·  Apr 01 2020
0h:12m:35s
Update sotabench.py
hussam789   2e5af26  ·  Apr 01 2020
0h:18m:48s
Update sotabench.py
hussam789   37fb185  ·  Apr 01 2020
0h:08m:55s
Update sotabench.py
hussam789   5135e64  ·  Apr 01 2020
0h:05m:50s
Update sotabench.py
hussam789   d1142d0  ·  Apr 01 2020
0h:06m:16s
Update sotabench.py
hussam789   77a3f80  ·  Apr 01 2020
0h:08m:56s
Update sotabench.py
hussam789   ca6ab4e  ·  Apr 01 2020
0h:07m:38s
Update sotabench.py
hussam789   df7a141  ·  Apr 01 2020
unknown
Update sotabench_setup.sh
hussam789   524ca28  ·  Apr 01 2020
0h:14m:29s
Update sotabench.py
hussam789   a3ff571  ·  Apr 01 2020
0h:09m:06s
Update sotabench.py
hussam789   55295af  ·  Apr 01 2020
0h:17m:28s
last try
mrT23 a2ac202    d993ec9  ·  Apr 01 2020
0h:15m:55s
install zlib
hussam789   a45609d  ·  Apr 01 2020
0h:07m:42s
try only pillow
mrT23   dd1d42d  ·  Apr 01 2020
unknown
mtresnet_batch_size=320, ltresnet_batch_size=288
hussam789   f279f57  ·  Apr 01 2020
0h:08m:52s
Update sotabench_setup.sh
hussam789   af3e4e3  ·  Apr 01 2020
0h:05m:58s
force uninstall
hussam789   9cf2cea  ·  Apr 01 2020
0h:06m:07s
XLTresnet batch_size=160
hussam789   a767dd2  ·  Apr 01 2020
0h:07m:46s
CC="cc -mavx2" python3 -m pip install -U --force-reinstall pillo…
mrT23   c856858  ·  Apr 01 2020
0h:05m:40s
python3 -m pip install --upgrade pip python3 -m pip install --up…
mrT23   7ddac7f  ·  Apr 01 2020
0h:05m:45s
pip uninstall pillow CC="cc -mavx2" pip install -U --force-reins…
mrT23   592371c  ·  Apr 01 2020
0h:05m:53s
try conda
mrT23   aecfcfa  ·  Apr 01 2020
0h:05m:50s
python -m pip install -U --force-reinstall pip
mrT23   5dc58b6  ·  Apr 01 2020
0h:08m:15s
export DEBIAN_FRONTEND=noninteractive
mrT23   e31c633  ·  Apr 01 2020
unknown
export DEBIAN_FRONTEND="noninteractive"
mrT23   fbfd96d  ·  Apr 01 2020
0h:10m:29s
# pillow simd try1
mrT23   b3f5819  ·  Apr 01 2020
0h:08m:43s
try bn fusion
mrT23   8990af1  ·  Apr 01 2020
0h:20m:54s
pin_memory
hussam789   55f722e  ·  Apr 01 2020
0h:15m:33s
Update README.md
hussam789   da6f186  ·  Apr 01 2020
0h:06m:14s
Update sotabench.py
hussam789   607f280  ·  Apr 01 2020
0h:14m:31s
Update sotabench.py
hussam789   4afe388  ·  Apr 01 2020
0h:08m:13s
Update sotabench.py
hussam789   c5e013b  ·  Apr 01 2020
0h:13m:14s
Update sotabench.py
hussam789   8fcad97  ·  Apr 01 2020
0h:10m:20s
Update sotabench_setup.sh
hussam789   fe19184  ·  Apr 01 2020
0h:13m:52s
Update sotabench.py
hussam789   386ea4d  ·  Apr 01 2020
0h:05m:17s
Update sotabench.py
hussam789   5f45443  ·  Apr 01 2020
0h:11m:18s
Update sotabench_setup.sh
hussam789   563253b  ·  Apr 01 2020
0h:03m:00s
Update sotabench_setup.sh
hussam789   0be4368  ·  Apr 01 2020
unknown
Update sotabench.py
hussam789   a59c0f9  ·  Apr 01 2020
0h:06m:42s
Update sotabench.py
hussam789   bc17ac6  ·  Apr 01 2020
0h:03m:11s
Update sotabench_setup.sh
hussam789   0e0727a  ·  Apr 01 2020
0h:03m:07s
Create sotabench_setup.sh
hussam789   01f85e9  ·  Apr 01 2020
0h:07m:08s
Update requirements.txt
hussam789   9f055d3  ·  Mar 31 2020
0h:02m:06s
Update requirements.txt
hussam789   ed3f377  ·  Mar 31 2020
0h:01m:25s
Update requirements.txt
hussam789   3bfb2eb  ·  Mar 31 2020
0h:02m:42s
Add Sotabench.py
hussam789   17d194f  ·  Mar 31 2020
0h:06m:52s
0h:02m:17s