evn - demo
July 21, 2026 · View on GitHub
conda create -n LTAP 3.8.11
source activate LTAP
pip install -r requirements.txt
python main.py --save_all_epoch --hesso --target_group_sparsity 0.1 --isc LT-vote --imb_ratio 100 --bs --gpu 1 > bs_1.log 2>&1 &
All the command templates have been placed in 1.sh; you can run it directly or execute individual commands from it.
About the large-scale datasets (ImageNet-LT & iNaturalist) / 关于两个大数据集
Due to copyright restrictions, we are unable to provide the data and the large-scale training code for the two larger datasets (ImageNet-LT and iNaturalist) in this repository. The missing pieces can, however, be traced back to the two upstream projects this work is built on:
- Pruning framework — Only Train Once (OTO)
(now maintained at microsoft/only_train_once):
the birthplace of the
only_train_once/HESSO/sanity_checkcode included here. The pruning itself (HESSO) is dataset-agnostic — it acts on the model, not the data — so it plugs into any training loop regardless of dataset size. Large-scale examples (e.g. ResNet50 on ImageNet) live in theOTOv2branch's main experiments and the distributed-training (DDP) tutorial. - Long-tailed training pipeline — NCL (Nested Collaborative Learning),
CVPR 2022: the earliest source of the long-tailed multi-expert code here
(
multi_Network_MOCO,Combiner,MoCo, thenclloss, etc.). It provides full, runnable configs and training scripts for the large-scale long-tailed datasets — ImageNet-LT (config/ImageNet_LT), iNaturalist 2018 (config/iNat18), and Places-LT (config/Places_LT). This is the piece that is missing here due to copyright, and it is where you should look first.
Applying the method described in this paper to the large-scale setting only requires minor modifications on top of these two repositories.
由于版权限制,本仓库无法提供两个较大数据集(ImageNet-LT 与 iNaturalist)的数据与大规模训练代码。 缺失的这部分可以追溯到本工作所依赖的两个上游项目:
- 剪枝框架 —— Only Train Once (OTO): 本仓库中
only_train_once/HESSO/sanity_check代码的“发源地”,其本身已包含适用于大数据集(如 ImageNet)的代码。- 长尾训练流程 —— NCL(Nested Collaborative Learning),CVPR 2022: 本仓库长尾多专家代码(
multi_Network_MOCO、Combiner、MoCo、ncl损失等)最早的出处。 这份“极早时期”的长尾代码提供了 ImageNet-LT、iNaturalist 2018、Places-LT 等大规模长尾数据集的完整配置与训练脚本。只需在上述两个仓库的基础上稍作修改,即可将本文提出的方法应用到大规模数据集上。
Pseudocode
ir =50
| Method | F | Head | Medium | Tail | All | C | C/F |
|---|---|---|---|---|---|---|---|
| ce | 100.0 | 68.0 | 38.0 | 13.2 | 46.0 | 100.0 | 1.0 |
| ce + ato | 84.7 | 46.7 | 17.3 | 6.83 | 29.1 | 63.2 | 0.7 |
| ce + regg | 52.1 | 43.8 | 14.8 | 0.83 | 24.5 | 53.2 | 1.0 |
| ce + ours w.o. | 23.3 | 64.5 | 30.0 | 4.5 | 39.5 | 85.8 | 3.6 |
| ce + ours | 23.3 | 64.8 | 31.7 | 7.2 | 41.1 | 89.3 | 3.8 |
| la | 100.0 | 59.9 | 46.7 | 41.3 | 51.3 | 100.0 | 1.0 |
| la + ato | 84.7 | 34.5 | 33.9 | 29.1 | 34.2 | 66.7 | 0.7 |
| la + regg | 52.1 | 31.0 | 30.2 | 25.8 | 29.9 | 58.3 | 1.1 |
| la + ours w.o. | 22.8 | 53.5 | 42.7 | 30.0 | 44.8 | 87.3 | 3.8 |
| la + ours | 22.8 | 54.0 | 43.4 | 38.4 | 47.1 | 91.8 | 4.0 |
ir = 100
| Method | F | Head | Medium | Tail | All | C | C/F |
|---|---|---|---|---|---|---|---|
| ce | 100.0 | 70.7 | 40.0 | 7.2 | 41.0 | 100.0 | 1.0 |
| ce + ato | 84.7 | 50.4 | 16.5 | 6.6 | 25.2 | 61.5 | 0.7 |
| ce + regg | 52.1 | 47.7 | 13.6 | 0.6 | 21.9 | 53.4 | 1.0 |
| ce + ours w.o. | 23.3 | 67.1 | 30.8 | 0.5 | 34.4 | 83.9 | 3.6 |
| ce + ours | 23.3 | 66.1 | 31.7 | 2.5 | 35.1 | 85.6 | 3.6 |
| la | 100.0 | 62.9 | 47.7 | 29.6 | 47.9 | 100.0 | 1.0 |
| la + ato | 84.7 | 42.1 | 30.6 | 18.4 | 31.4 | 65.6 | 0.7 |
| la + regg | 52.1 | 38.5 | 27.0 | 14.6 | 27.6 | 57.6 | 1.1 |
| la + ours w.o. | 22.8 | 55.1 | 42.0 | 18.6 | 39.5 | 82.4 | 3.6 |
| la + ours | 22.8 | 56.1 | 45.3 | 22.6 | 42.6 | 88.9 | 3.9 |