mmrotate自己训练修改参数

1.tools/train.py 

修改训练所需的模型  和  训练获得权重的目标文件夹(文件夹会自动创建)

parser.add_argument('--config', defualt='/home/zhh/download/mmrotate-main/tools/train-/s2anet_r50_fpn_1x_dota_le135.py', help='train config file path')
parser.add_argument('--work-dir', default='/home/zhh/download/mmrotate-main/tools/train-/run', help='the dir to save logs and models')

 

2.s2anet_r50_fpn_1x_dota_le135.py

 改为绝对路径

--------------------------------------------------------------------------------------------------------------------------------

 模型选择

--------------------------------------------------------------------------------------------------------------------------------

 

 想要训练成几类,就改成几

--------------------------------------------------------------------------------------------------------------------------------

3.mmrotate-main/mmrotate/datasets/dota.py

修改文件中的类别名字(CLASSES)

 

4._base_/datasets/dotav1.py

 选择裁剪好的三个文件夹train、val、test的父文件夹

--------------------------------------------------------------------------------------------------------------------------------

 分别填写刚刚父文件夹下的路径

5._base_/schedules/schedule_1x.py

# evaluation
evaluation = dict(interval=1, metric='mAP')        #每训练1轮报一遍mAP
# optimizer
optimizer = dict(type='SGD', lr=0.0025, momentum=0.9, weight_decay=0.0001)    #     调整学习率
optimizer_config = dict(grad_clip=dict(max_norm=35, norm_type=2))
# learning policy    
lr_config = dict(
    policy='step',
    warmup='linear',
    warmup_iters=500,
    warmup_ratio=1.0 / 3,
    step=[130, 180])    #  在第130轮降低一次学习率,在第180轮再降低一次学习率
runner = dict(type='EpochBasedRunner', max_epochs=200)    #  训练200轮
checkpoint_config = dict(interval=10)     #  模型每10轮保存一次

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值