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_check code 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 the OTOv2 branch'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, the ncl loss, 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-LTiNaturalist)的数据与大规模训练代码。 缺失的这部分可以追溯到本工作所依赖的两个上游项目:

  • 剪枝框架 —— Only Train Once (OTO) 本仓库中 only_train_once / HESSO / sanity_check 代码的“发源地”,其本身已包含适用于大数据集(如 ImageNet)的代码。
  • 长尾训练流程 —— NCL(Nested Collaborative Learning),CVPR 2022: 本仓库长尾多专家代码(multi_Network_MOCOCombinerMoConcl 损失等)最早的出处。 这份“极早时期”的长尾代码提供了 ImageNet-LTiNaturalist 2018Places-LT 等大规模长尾数据集的完整配置与训练脚本。

只需在上述两个仓库的基础上稍作修改,即可将本文提出的方法应用到大规模数据集上。

Pseudocode

示例图片

ir =50

MethodFHeadMediumTailAllCC/F
ce100.068.038.013.246.0100.01.0
ce + ato84.746.717.36.8329.163.20.7
ce + regg52.143.814.80.8324.553.21.0
ce + ours w.o. κ\kappa23.364.530.04.539.585.83.6
ce + ours23.364.831.77.241.189.33.8
la100.059.946.741.351.3100.01.0
la + ato84.734.533.929.134.266.70.7
la + regg52.131.030.225.829.958.31.1
la + ours w.o. κ\kappa22.853.542.730.044.887.33.8
la + ours22.854.043.438.447.191.84.0

ir = 100

MethodFHeadMediumTailAllCC/F
ce100.070.740.07.241.0100.01.0
ce + ato84.750.416.56.625.261.50.7
ce + regg52.147.713.60.621.953.41.0
ce + ours w.o. κ\kappa23.367.130.80.534.483.93.6
ce + ours23.366.131.72.535.185.63.6
la100.062.947.729.647.9100.01.0
la + ato84.742.130.618.431.465.60.7
la + regg52.138.527.014.627.657.61.1
la + ours w.o. κ\kappa22.855.142.018.639.582.43.6
la + ours22.856.145.322.642.688.93.9