【CenterFusion】训练脚本CenterFusion/experiments/train.sh

本文详细解释了在README.md文件中关于CenterNet模型训练的命令行参数,包括数据集划分、训练设置(如学习率、epoch数、数据增强)、GPU使用、模型加载等关键部分。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  • 在 README.md 中训练模型的命令是:bash experiments/train.sh
  • 首先执行的就是 train.sh 脚本
  • 在脚本中 --参数 值 表示可选参数
cd src
python main.py \
    ddd \
    '''
    可以理解为工作空间名,也就是文件夹名
    '''
    --exp_id centerfusion \
    '''
    项目名称
    '''
    --shuffle_train \
    '''
    将训练模型的数据集进行打乱的操作
    '''
    --train_split train \
    '''
    训练集
    '''
    --val_split mini_val \
    '''
    测试集
    '''
    --val_intervals 1 \
    '''
    运行测试集的 epoch 数为 1
    比如 1000 个样本用来训练一个神经网络,训练就算完成 1 epoch(期)
    '''
    --run_dataset_eval \
    '''
    在 eval 中使用数据集特定的计算函数
    '''
    --nuscenes_att \
    --velocity \
    --batch_size 32 \
    '''
    一次训练抓取 32 个数据样本
    '''
    --lr 2.5e-4 \
    '''
    学习率:0.00025
    '''
    --num_epochs 60 \
    '''
    训练 60'''
    --lr_step 50 \
    '''
    学习率步长
    '''
    --save_point 20,40,50 \
    '''
    模型保存时间点
    '''
    --gpus 0,1 \
    '''
    这里使用了两块 GPU :0 号 GPU 和 1 号 GPU
    '''
    --not_rand_crop \
    '''
    不使用来自 CenterNet 的随机裁剪数据增强
    '''
    --flip 0.5 \
    '''
    使用翻转数据增强的概率 50%
    '''
    --shift 0.1 \
    '''
    当不使用随机裁剪时,10% 概率使用移位增强
    '''
    --pointcloud \
    '''
    雷达点云
    '''
    --radar_sweeps 3 \
    '''
    点云图中雷达扫瞄 3'''
    --pc_z_offset 0.0 \
    '''
    向 z 轴方面提高雷达点
    '''
    --pillar_dims 1.0,0.2,0.2 \
    '''
    雷达柱尺寸(h、w、l)
    '''
    --max_pc_dist 60.0 \
    '''
    移除最大点云距离 60 以外的点
    '''
    --load_model ../models/centernet_baseline_e170.pth \
    '''
    导入的模型
    '''
cd ..
Training AttnSleep For updating the training parameters, you have to update the `config.json` file. In this file, you can update: - The experiment name (Recommended to update this for different experiments) - The number of GPUs. - Batch size. - Number of folds (as we use K-fold cross validation). - Optimizer type along with its parameters. - the loss function. (to update this you have to include the new loss function in the [loss.py](./model/loss.py) file). - the evaluation metrics (also to add more metrics, update the [metrics.py](./model/metric.py) file). - The number of training epochs. - The save directory (location of saving the results of experiment) - The save_period (the interval of saving the checkpoints and best model). - verbosity of log (0 for less logs, 2 for all logs, 1 in between) To perform the standard K-fold cross validation, specify the number of folds in `config.json` and run the following: ``` chmod +x batch_train.sh ./batch_train.sh 0 /path/to/npz/files ``` where the first argument represents the GPU id (If you want to use CPU, set the number of gpus to 0 in the config file) If you want to train only one specific fold (e.g. fold 10), use this command: ``` python train_Kfold_CV.py --device 0 --fold_id 10 --np_data_dir /path/to/npz/files ``` ## Results The log file of each fold is found in the fold directory inside the save_dir. The final classification report is found the experiment directory and note that it sums up all the folds results to calculate the metrics.
最新发布
03-23
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

HIT_Vanni

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值