在進行深度學習訓練的過程中,往往會跑很多實驗,這就導致有的實驗設置會忘記或者記混淆,我們最好把train test model 的代碼都copy一遍到指定文件夾中,這樣后面檢查也方便。
用shell指令保存文件
#!/bin/sh
GRUB_CMDLINE_LINUX="iommu=soft"
export CUDA_VISIBLE_DEVICES=1,2,3,4save_dir=./saved_distill_128_fea_ctx
if [ ! -d $save_dir ];then #判斷文件夾是否存在mkdir $save_direcho mkdir $save_dir
elseecho dir exist $save_dir
fi
nohup python -u train_bxh.py \
--train_data /search/odin/boqin/BIAN/scatter-2020_new/haoweilai-wiki-110w-train-lmdb \
--valid_data /search/odin/boqin/BIAN/scatter-2020_new/haoweilai-wiki-110w-train-lmdb \
--character ./dictionary_v1.txt \
--batch_size 45 \
--PAD \
--exp_name hwl-wiki-110w-exp-opencv-test \
--lr 0.5 \
--feature_rate 1 \
--ctx_rate 1 \
--lambda_kl 50 \
--output_channel_student 128 \
--hidden_size_student 128 \
--inter_rate 4 \
--print_interval 10 \
--original_model_path ./epoch_12.pth \
--save_path $save_dir \
1>$save_dir/log.txt 2>&1 & cp ./train_bxh.py $save_dir # copy 文件到指定的文件夾中
cp ./model.py $save_dir
cp ./train.sh $save_dir
cp -R ./modules $save_dir# --check_point /home/qinbo/BIAN/scatter-2020_new/saved_model_distill_7/hwl-wiki-110w-exp-opencv-test/epoch_2_iteraiton_20500.pth \