This commit is contained in:
2024-06-13 12:13:54 +08:00
commit db40d1af1b
38 changed files with 5006 additions and 0 deletions

45
config.ini Normal file
View File

@@ -0,0 +1,45 @@
[Train]
;True使用cuda训练
cuda = True
; 用于固定随机种子
; 使得每次独立训练都可以获得一样的结果
seed = 12
;distributed 用于指定是否使用单机多卡分布式运行
; 终端指令仅支持Ubuntu。CUDA_VISIBLE_DEVICES用于在Ubuntu下指定显卡。
; Windows系统下默认使用DP模式调用所有显卡不支持DDP。
;DP模式
; 设置 distributed = False
; 在终端中输入 CUDA_VISIBLE_DEVICES=0,1 python train.py
;DDP模式
; 设置 distributed = True
; 在终端中输入 CUDA_VISIBLE_DEVICES=0,1 python -m torch.distributed.launch --nproc_per_node=2 train.py
distributed = False
; sync_bn 是否使用sync_bnDDP模式多卡可用
sync_bn = False
fp16 = False
classes_path = model_data/voc_classes.txt
anchors_path = model_data/yolo_anchors.txt
anchors_mask = [[6, 7, 8], [3, 4, 5], [0, 1, 2]]
model_path =
input_shape = [640, 640]
backbone = cspdarknet
pretrained = False
phi = x
; mosaic 马赛克数据增强。
; mosaic_prob 每个step有多少概率使用mosaic数据增强默认50%。
; mixup 是否使用mixup数据增强仅在mosaic=True时有效。
; 只会对mosaic增强后的图片进行mixup的处理。
; mixup_prob 有多少概率在mosaic后使用mixup数据增强默认50%。
; 总的mixup概率为mosaic_prob * mixup_prob。
; special_aug_ratio 参考YoloX由于Mosaic生成的训练图片远远脱离自然图片的真实分布。
; 当mosaic=True时本代码会在special_aug_ratio范围内开启mosaic。
; 默认为前70%个epoch100个世代会开启70个世代。
mosaic = False
mosaic_prob = 0.5
mixup = True
mixup_prob = 0.5
special_aug_ratio = 0.7
; label_smoothing 标签平滑。一般0.01以下。如0.01、0.005。
label_smoothing = 0.01