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=[8, 11]) checkpoint_config = dict(interval=1) # yapf:disable log_config = dict( interval=50, hoo...
checkpoint_config = dict(interval=5) # 每5个epoch保存一次权重# yapf:disablelog_config = dict(interval=50, # 每500个迭代就打印一次训练信息hooks=[dict(type='TextLoggerHook'),# dict(type='TensorboardLoggerHook')])# yapf:enablecustom_hooks = [dict(type='NumClassCheckHook')]dist_params = di...
total_epochs = 12 # model训练的总epoch数checkpoint_config = dict( # 设置checkpoint hook, 具体细节请参照https://github.com/open-mmlab/mmcv/blob/master/mmcv/runner/hooks/checkpoint.py 的实现. interval=1) # 每隔几个epoch保存一下checkpoint log_config = dict( # logger文件的配置 interval=50, #...
checkpoint_config = dict( # Checkpoint hook 的配置文件。执行时请参考 https://github.com/open-mmlab/mmcv/blob/master/mmcv/runner/hooks/checkpoint.py。 interval=1) # 保存的间隔是 1。 log_config = dict( # register logger hook 的配置文件。 interval=50, # 打印日志的间隔 hooks=[ # dict(type...
–resume_from:指定在某个checkpoint的基础上继续训练,若在脚本中不设置,则为config/*.py中resume_from中的值,默认为None。 –validate:指是否在训练中建立checkpoint的时候对该checkpoint进行评估 –gpus: 指使用GPU的数量,默认值为1 build_detector build_dataset ...
checkpoint_file = 'checkpoints/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth' # 初始化检测器 model = init_detector(config_file, checkpoint_file, device='cuda:0') # 进行目标检测 img = 'test.jpg' # 待检测图像路径 result = inference_detector(model, img) # 显示检测结果 show_result...
runner.register_training_hooks(cfg.lr_config,optimizer_config,cfg.checkpoint_config,cfg.log_config,cfg.get('momentum_config',None))#5.如果需要 val,则还需要注册 EvalHook runner.register_hook(eval_hook(val_dataloader,**eval_cfg))#6.注册用户自定义 hook ...
checkpoint_config = dict(interval=1) # yapf:disable log_config = dict( interval=50, hooks=[ dict(type='TextLoggerHook'), # dict(type='TensorboardL0oggerHook') ]) # yapf:enable # runtime settings total_epochs = 50 dist_params = dict(backend='nccl') ...
schedule related settings optimizer = dict(type='SGD', lr=0.005, momentum=0.9, weight_decay=0.0001) total_epochs = 10000 # Modify runtime related settings checkpoint_config = dict(interval=10) # We can use the pre-trained model to obtain higher performance # load_from = 'checkpoints/*....
改为自己的 checkpoint_path = "./work_dirs/xuliandi/cascade_rcnn_r50_fpn_1x/best_bbox_mAP_epoch_9.pth" # 权重文件,改为自己的 config = config_path checkpoint = checkpoint_path model = init_detector(config, checkpoint, device=DEVICE) def inference_res(model, image_input): results = []...