Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
wmkai afda586ccf | 1 year ago | |
---|---|---|
.idea | 2 years ago | |
CKA | 2 years ago | |
Cifar | 2 years ago | |
Imagenet | 2 years ago | |
ToyExample | 2 years ago | |
README.md | 1 year ago | |
requirements.txt | 2 years ago | |
run.py | 1 year ago |
pip install -r requirements.txt
feature extract
# [optional]cache imagenet dataset in RAM for accelerting I/O
code_path='/ITPruner/Imagenet/'
chmod +x ${code_path}/prep_imagenet.sh
cd ${code_path}
echo "preparing data"
bash ${code_path}/prep_imagenet.sh >> /dev/null
echo "preparing data finished"
python3 -m torch.distributed.launch --nproc_per_node=1 feature_extract.py \
--model "mobilenet" \
--path "Exp_base/mobilenet_base" \
--dataset "imagenet" \
--save_path 'your_data_path' \
--target_flops 150000000 \
--beta 243
or
bash ./run_scripts/feature_extract/extract_mobilenet_150m.sh
Train
Because of random seed, cfg obtained through feature extraction may have a little difference from ours. Our cfg are given in .sh files.
# [optional]cache imagenet dataset in RAM for accelerting I/O
code_path='/ITPruner/Imagenet/'
chmod +x ${code_path}/prep_imagenet.sh
cd ${code_path}
echo "preparing data"
bash ${code_path}/prep_imagenet.sh >> /dev/null
echo "preparing data finished"
python3 -m torch.distributed.launch --nproc_per_node=4 train.py --train \
--model "mobilenet" \
--cfg "[23, 42, 63, 67, 132, 134, 275, 194, 202, 202, 194, 277, 522, 687]" \
--path "Exp_train/train_mobilenet_150m_${RANDOM}" \
--dataset "imagenet" \
--save_path 'your_data_path' \
--base_path "Exp_base/mobilenet_base" \
--warm_epoch 1 \
--sync_bn \
--n_epochs 250 \
--label_smoothing 0.1
or
bash ./run_scripts/train/train_mobilenet_150m.sh
Evaluate
We provide some pretrain_models which we list in the paper.
python3 -m torch.distributed.launch --nproc_per_node=1 evaluate.py \
--model "mobilenet" \
--path "pretrain_models/train_mobilenet_150m_31752" \
--dataset "imagenet" \
--save_path 'your_data_path' \
--cfg "[23, 42, 63, 67, 132, 134, 275, 194, 202, 202, 194, 277, 522, 687]"
or
bash ./run_scripts/evaluate/evaluate_mobilenet_150m.sh
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》