1 Star 0 Fork 49

思想的光芒 / DeepSparkHub

forked from DeepSpark / DeepSparkHub 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 2.83 KB
一键复制 编辑 原始数据 按行查看 历史

FasterNet

Model description

This is the official Pytorch/PytorchLightning implementation of the paper:

Run, Don't Walk: Chasing Higher FLOPS for Faster Neural Networks
Jierun Chen, Shiu-hong Kao, Hao He, Weipeng Zhuo, Song Wen, Chul-Ho Lee, S.-H. Gary Chan
IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2023

We propose a simple yet fast and effective partial convolution (PConv), as well as a latency-efficient family of architectures called FasterNet.

Step 1: Installation

Clone this repo and install the required packages:

pip install -r requirements.txt

Step 2: Preparing datasets

Sign up and login in ImageNet official website, then choose 'Download' to download the whole ImageNet dataset. Specify /path/to/imagenet to your ImageNet path in later training process.

The ImageNet dataset path structure should look like:

imagenet
├── train
│   └── n01440764
│       ├── n01440764_10026.JPEG
│       └── ...
├── train_list.txt
├── val
│   └── n01440764
│       ├── ILSVRC2012_val_00000293.JPEG
│       └── ...
└── val_list.txt

Step 3: Training

Remark: Training will prompt wondb visualization options, you'll need a W&B account to visualize, choose "3" if you don't need to.

FasterNet-T0 training on ImageNet with a 8-GPU node:

# You can change the dataset path '--data_dir' according to your own dataset path !!!
python3 train_test.py -g 0,1,2,3,4,5,6,7 --num_nodes 1 -n 4 -b 4096 -e 2000 \
                      --data_dir /path/to/imagenet \
                      --pin_memory --wandb_project_name fasternet \
                      --model_ckpt_dir ./model_ckpt/$(date +'%Y%m%d_%H%M%S') \
                      --cfg cfg/fasternet_t0.yaml

FasterNet-T0 training on ImageNet-1K with a 1-GPU node:

# You can change the dataset path '--data_dir' according to your own dataset path !!!
python3 train_test.py -g 0 --num_nodes 1 -n 4 -b 512 -e 2000 \
                      --data_dir /path/to/imagenet \
                      --pin_memory --wandb_project_name fasternet \
                      --model_ckpt_dir ./model_ckpt/$(date +'%Y%m%d_%H%M%S') \
                      --cfg cfg/fasternet_t0.yaml

To train other FasterNet variants, --cfg need to be changed. You may also want to change the training batch size -b.

Results

GPUs FP32
BI-V100 x8 test_acc1 71.832 val_acc1 71.722

Reference

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/Hcl11/deepsparkhub.git
git@gitee.com:Hcl11/deepsparkhub.git
Hcl11
deepsparkhub
DeepSparkHub
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891