diff --git a/docs/en/tutorials/config.md b/docs/en/tutorials/config.md index 6b232cf54..9f7759a20 100644 --- a/docs/en/tutorials/config.md +++ b/docs/en/tutorials/config.md @@ -71,8 +71,8 @@ The `train_cfg` and `test_cfg` are deprecated in config file, please specify the ```python # deprecated model = dict( - type=..., - ... + type=..., + ... ) train_cfg=dict(...) test_cfg=dict(...) @@ -83,10 +83,10 @@ The migration example is as below. ```python # recommended model = dict( - type=..., - ... - train_cfg=dict(...), - test_cfg=dict(...), + type=..., + ... +train_cfg=dict(...), + test_cfg=dict(...), ) ``` @@ -109,8 +109,8 @@ model = dict( type='BN', # Type of norm layer, usually it is BN or GN requires_grad=True), # Whether to train the gamma and beta in BN norm_eval=True, # Whether to freeze the statistics in BN - style='pytorch', # The style of backbone, 'pytorch' means that stride 2 layers are in 3x3 conv, 'caffe' means stride 2 layers are in 1x1 convs. - init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')), # The ImageNet pretrained backbone to be loaded + style='pytorch', # The style of backbone, 'pytorch' means that stride 2 layers are in 3x3 conv, 'caffe' means stride 2 layers are in 1x1 convs. + init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')), # The ImageNet pretrained backbone to be loaded neck=dict( type='FPN', # The neck of detector is FPN. We also support 'NASFPN', 'PAFPN', etc. Refer to https://github.com/open-mmlab/mmdetection/blob/master/mmdet/models/necks/fpn.py#L10 for more details. in_channels=[256, 512, 1024, 2048], # The input channels, this is consistent with the output channels of backbone @@ -182,70 +182,70 @@ model = dict( type='CrossEntropyLoss', # Type of loss used for segmentation use_mask=True, # Whether to only train the mask in the correct class. loss_weight=1.0)))) # Loss weight of mask branch. - train_cfg = dict( # Config of training hyperparameters for rpn and rcnn - rpn=dict( # Training config of rpn - assigner=dict( # Config of assigner - type='MaxIoUAssigner', # Type of assigner, MaxIoUAssigner is used for many common detectors. Refer to https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/assigners/max_iou_assigner.py#L10 for more details. - pos_iou_thr=0.7, # IoU >= threshold 0.7 will be taken as positive samples - neg_iou_thr=0.3, # IoU < threshold 0.3 will be taken as negative samples - min_pos_iou=0.3, # The minimal IoU threshold to take boxes as positive samples - match_low_quality=True, # Whether to match the boxes under low quality (see API doc for more details). - ignore_iof_thr=-1), # IoF threshold for ignoring bboxes - sampler=dict( # Config of positive/negative sampler - type='RandomSampler', # Type of sampler, PseudoSampler and other samplers are also supported. Refer to https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/samplers/random_sampler.py#L8 for implementation details. - num=256, # Number of samples - pos_fraction=0.5, # The ratio of positive samples in the total samples. - neg_pos_ub=-1, # The upper bound of negative samples based on the number of positive samples. - add_gt_as_proposals=False), # Whether add GT as proposals after sampling. - allowed_border=-1, # The border allowed after padding for valid anchors. - pos_weight=-1, # The weight of positive samples during training. - debug=False), # Whether to set the debug mode - rpn_proposal=dict( # The config to generate proposals during training - nms_across_levels=False, # Whether to do NMS for boxes across levels. Only work in `GARPNHead`, naive rpn does not support do nms cross levels. - nms_pre=2000, # The number of boxes before NMS - nms_post=1000, # The number of boxes to be kept by NMS, Only work in `GARPNHead`. - max_per_img=1000, # The number of boxes to be kept after NMS. - nms=dict( # Config of NMS - type='nms', # Type of NMS - iou_threshold=0.7 # NMS threshold - ), - min_bbox_size=0), # The allowed minimal box size - rcnn=dict( # The config for the roi heads. - assigner=dict( # Config of assigner for second stage, this is different for that in rpn - type='MaxIoUAssigner', # Type of assigner, MaxIoUAssigner is used for all roi_heads for now. Refer to https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/assigners/max_iou_assigner.py#L10 for more details. - pos_iou_thr=0.5, # IoU >= threshold 0.5 will be taken as positive samples - neg_iou_thr=0.5, # IoU < threshold 0.5 will be taken as negative samples - min_pos_iou=0.5, # The minimal IoU threshold to take boxes as positive samples - match_low_quality=False, # Whether to match the boxes under low quality (see API doc for more details). - ignore_iof_thr=-1), # IoF threshold for ignoring bboxes - sampler=dict( - type='RandomSampler', # Type of sampler, PseudoSampler and other samplers are also supported. Refer to https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/samplers/random_sampler.py#L8 for implementation details. - num=512, # Number of samples - pos_fraction=0.25, # The ratio of positive samples in the total samples. - neg_pos_ub=-1, # The upper bound of negative samples based on the number of positive samples. - add_gt_as_proposals=True - ), # Whether add GT as proposals after sampling. - mask_size=28, # Size of mask - pos_weight=-1, # The weight of positive samples during training. - debug=False)) # Whether to set the debug mode - test_cfg = dict( # Config for testing hyperparameters for rpn and rcnn - rpn=dict( # The config to generate proposals during testing - nms_across_levels=False, # Whether to do NMS for boxes across levels. Only work in `GARPNHead`, naive rpn does not support do nms cross levels. - nms_pre=1000, # The number of boxes before NMS - nms_post=1000, # The number of boxes to be kept by NMS, Only work in `GARPNHead`. - max_per_img=1000, # The number of boxes to be kept after NMS. - nms=dict( # Config of NMS - type='nms', #Type of NMS - iou_threshold=0.7 # NMS threshold - ), - min_bbox_size=0), # The allowed minimal box size - rcnn=dict( # The config for the roi heads. - score_thr=0.05, # Threshold to filter out boxes - nms=dict( # Config of NMS in the second stage - type='nms', # Type of NMS - iou_thr=0.5), # NMS threshold - max_per_img=100, # Max number of detections of each image - mask_thr_binary=0.5)) # Threshold of mask prediction +train_cfg = dict( # Config of training hyperparameters for rpn and rcnn + rpn=dict( # Training config of rpn + assigner=dict( # Config of assigner + type='MaxIoUAssigner', # Type of assigner, MaxIoUAssigner is used for many common detectors. Refer to https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/assigners/max_iou_assigner.py#L10 for more details. + pos_iou_thr=0.7, # IoU >= threshold 0.7 will be taken as positive samples + neg_iou_thr=0.3, # IoU < threshold 0.3 will be taken as negative samples + min_pos_iou=0.3, # The minimal IoU threshold to take boxes as positive samples + match_low_quality=True, # Whether to match the boxes under low quality (see API doc for more details). + ignore_iof_thr=-1), # IoF threshold for ignoring bboxes + sampler=dict( # Config of positive/negative sampler + type='RandomSampler', # Type of sampler, PseudoSampler and other samplers are also supported. Refer to https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/samplers/random_sampler.py#L8 for implementation details. + num=256, # Number of samples + pos_fraction=0.5, # The ratio of positive samples in the total samples. + neg_pos_ub=-1, # The upper bound of negative samples based on the number of positive samples. + add_gt_as_proposals=False), # Whether add GT as proposals after sampling. + allowed_border=-1, # The border allowed after padding for valid anchors. + pos_weight=-1, # The weight of positive samples during training. + debug=False), # Whether to set the debug mode + rpn_proposal=dict( # The config to generate proposals during training + nms_across_levels=False, # Whether to do NMS for boxes across levels. Only work in `GARPNHead`, naive rpn does not support do nms cross levels. + nms_pre=2000, # The number of boxes before NMS + nms_post=1000, # The number of boxes to be kept by NMS, Only work in `GARPNHead`. + max_per_img=1000, # The number of boxes to be kept after NMS. + nms=dict( # Config of NMS + type='nms', # Type of NMS + iou_threshold=0.7 # NMS threshold + ), + min_bbox_size=0), # The allowed minimal box size + rcnn=dict( # The config for the roi heads. + assigner=dict( # Config of assigner for second stage, this is different for that in rpn + type='MaxIoUAssigner', # Type of assigner, MaxIoUAssigner is used for all roi_heads for now. Refer to https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/assigners/max_iou_assigner.py#L10 for more details. + pos_iou_thr=0.5, # IoU >= threshold 0.5 will be taken as positive samples + neg_iou_thr=0.5, # IoU < threshold 0.5 will be taken as negative samples + min_pos_iou=0.5, # The minimal IoU threshold to take boxes as positive samples + match_low_quality=False, # Whether to match the boxes under low quality (see API doc for more details). + ignore_iof_thr=-1), # IoF threshold for ignoring bboxes + sampler=dict( + type='RandomSampler', # Type of sampler, PseudoSampler and other samplers are also supported. Refer to https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/samplers/random_sampler.py#L8 for implementation details. + num=512, # Number of samples + pos_fraction=0.25, # The ratio of positive samples in the total samples. + neg_pos_ub=-1, # The upper bound of negative samples based on the number of positive samples. + add_gt_as_proposals=True + ), # Whether add GT as proposals after sampling. + mask_size=28, # Size of mask + pos_weight=-1, # The weight of positive samples during training. + debug=False)) # Whether to set the debug mode +test_cfg = dict( # Config for testing hyperparameters for rpn and rcnn + rpn=dict( # The config to generate proposals during testing + nms_across_levels=False, # Whether to do NMS for boxes across levels. Only work in `GARPNHead`, naive rpn does not support do nms cross levels. + nms_pre=1000, # The number of boxes before NMS + nms_post=1000, # The number of boxes to be kept by NMS, Only work in `GARPNHead`. + max_per_img=1000, # The number of boxes to be kept after NMS. + nms=dict( # Config of NMS + type='nms', #Type of NMS + iou_threshold=0.7 # NMS threshold + ), + min_bbox_size=0), # The allowed minimal box size + rcnn=dict( # The config for the roi heads. + score_thr=0.05, # Threshold to filter out boxes + nms=dict( # Config of NMS in the second stage + type='nms', # Type of NMS + iou_thr=0.5), # NMS threshold + max_per_img=100, # Max number of detections of each image + mask_thr_binary=0.5)) # Threshold of mask prediction dataset_type = 'CocoDataset' # Dataset type, this will be used to define the dataset data_root = 'data/coco/' # Root path of data img_norm_cfg = dict( # Image normalization config to normalize the input images @@ -381,7 +381,7 @@ data = dict( ]) ], samples_per_gpu=2 # Batch size of a single GPU used in testing - )) + )) evaluation = dict( # The config to build the evaluation hook, refer to https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/evaluation/eval_hooks.py#L7 for more details. interval=1, # Evaluation interval metric=['bbox', 'segm']) # Metrics used during evaluation @@ -407,9 +407,15 @@ checkpoint_config = dict( # Config to set the checkpoint hook, Refer to https:/ log_config = dict( # config to register logger hook interval=50, # Interval to print the log hooks=[ - # dict(type='TensorboardLoggerHook') # The Tensorboard logger is also supported - dict(type='TextLoggerHook') + dict(type='TextLoggerHook', by_epoch=False), + dict(type='TensorboardLoggerHook', by_epoch=False), + dict(type='MMDetWandbHook', by_epoch=False, # The Wandb logger is also supported, It requires `wandb` to be installed. + init_kwargs={'entity': "OpenMMLab", # The entity used to log on Wandb + 'project': "MMDet", # Project name in WandB + 'config': cfg_dict}), # Check https://docs.wandb.ai/ref/python/init for more init arguments. + # MMDetWandbHook is mmdet implementation of WandbLoggerHook. ClearMLLoggerHook, DvcliveLoggerHook, MlflowLoggerHook, NeptuneLoggerHook, PaviLoggerHook, SegmindLoggerHook are also supported based on MMCV implementation. ]) # The logger used to record the training process. + dist_params = dict(backend='nccl') # Parameters to setup distributed training, the port can also be set. log_level = 'INFO' # The level of logging. load_from = None # load models as a pre-trained model from a given path. This will not resume training. diff --git a/docs/zh_cn/tutorials/config.md b/docs/zh_cn/tutorials/config.md index 42b098f63..404608780 100644 --- a/docs/zh_cn/tutorials/config.md +++ b/docs/zh_cn/tutorials/config.md @@ -56,8 +56,8 @@ ```python # 已经弃用的形式 model = dict( - type=..., - ... + type=..., + ... ) train_cfg=dict(...) test_cfg=dict(...) @@ -68,10 +68,10 @@ test_cfg=dict(...) ```python # 推荐的形式 model = dict( - type=..., - ... - train_cfg=dict(...), - test_cfg=dict(...), + type=..., + ... +train_cfg=dict(...), + test_cfg=dict(...), ) ``` @@ -93,7 +93,7 @@ model = dict( requires_grad=True), # 是否训练归一化里的 gamma 和 beta。 norm_eval=True, # 是否冻结 BN 里的统计项。 style='pytorch', # 主干网络的风格,'pytorch' 意思是步长为2的层为 3x3 卷积, 'caffe' 意思是步长为2的层为 1x1 卷积。 - init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')), # 加载通过 ImageNet 预训练的模型 + init_cfg=dict(type='Pretrained', checkpoint='torchvision://resnet50')), # 加载通过 ImageNet 预训练的模型 neck=dict( type='FPN', # 检测器的 neck 是 FPN,我们同样支持 'NASFPN', 'PAFPN' 等,更多细节可以参考 https://github.com/open-mmlab/mmdetection/blob/master/mmdet/models/necks/fpn.py#L10。 in_channels=[256, 512, 1024, 2048], # 输入通道数,这与主干网络的输出通道一致 @@ -165,70 +165,70 @@ model = dict( type='CrossEntropyLoss', # 用于分割的损失类型。 use_mask=True, # 是否只在正确的类中训练 mask。 loss_weight=1.0)))) # mask 分支的损失权重. - train_cfg = dict( # rpn 和 rcnn 训练超参数的配置 - rpn=dict( # rpn 的训练配置 - assigner=dict( # 分配器(assigner)的配置 - type='MaxIoUAssigner', # 分配器的类型,MaxIoUAssigner 用于许多常见的检测器,更多细节请参考 https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/assigners/max_iou_assigner.py#L10。 - pos_iou_thr=0.7, # IoU >= 0.7(阈值) 被视为正样本。 - neg_iou_thr=0.3, # IoU < 0.3(阈值) 被视为负样本。 - min_pos_iou=0.3, # 将框作为正样本的最小 IoU 阈值。 - match_low_quality=True, # 是否匹配低质量的框(更多细节见 API 文档). - ignore_iof_thr=-1), # 忽略 bbox 的 IoF 阈值。 - sampler=dict( # 正/负采样器(sampler)的配置 - type='RandomSampler', # 采样器类型,还支持 PseudoSampler 和其他采样器,更多细节请参考 https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/samplers/random_sampler.py#L8。 - num=256, # 样本数量。 - pos_fraction=0.5, # 正样本占总样本的比例。 - neg_pos_ub=-1, # 基于正样本数量的负样本上限。 - add_gt_as_proposals=False), # 采样后是否添加 GT 作为 proposal。 - allowed_border=-1, # 填充有效锚点后允许的边框。 - pos_weight=-1, # 训练期间正样本的权重。 - debug=False), # 是否设置调试(debug)模式 - rpn_proposal=dict( # 在训练期间生成 proposals 的配置 - nms_across_levels=False, # 是否对跨层的 box 做 NMS。仅适用于 `GARPNHead` ,naive rpn 不支持 nms cross levels。 - nms_pre=2000, # NMS 前的 box 数 - nms_post=1000, # NMS 要保留的 box 的数量,只在 GARPNHHead 中起作用。 - max_per_img=1000, # NMS 后要保留的 box 数量。 - nms=dict( # NMS 的配置 - type='nms', # NMS 的类别 - iou_threshold=0.7 # NMS 的阈值 - ), - min_bbox_size=0), # 允许的最小 box 尺寸 - rcnn=dict( # roi head 的配置。 - assigner=dict( # 第二阶段分配器的配置,这与 rpn 中的不同 - type='MaxIoUAssigner', # 分配器的类型,MaxIoUAssigner 目前用于所有 roi_heads。更多细节请参考 https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/assigners/max_iou_assigner.py#L10。 - pos_iou_thr=0.5, # IoU >= 0.5(阈值)被认为是正样本。 - neg_iou_thr=0.5, # IoU < 0.5(阈值)被认为是负样本。 - min_pos_iou=0.5, # 将 box 作为正样本的最小 IoU 阈值 - match_low_quality=False, # 是否匹配低质量下的 box(有关更多详细信息,请参阅 API 文档)。 - ignore_iof_thr=-1), # 忽略 bbox 的 IoF 阈值 - sampler=dict( - type='RandomSampler', #采样器的类型,还支持 PseudoSampler 和其他采样器,更多细节请参考 https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/samplers/random_sampler.py#L8。 - num=512, # 样本数量 - pos_fraction=0.25, # 正样本占总样本的比例。. - neg_pos_ub=-1, # 基于正样本数量的负样本上限。. - add_gt_as_proposals=True - ), # 采样后是否添加 GT 作为 proposal。 - mask_size=28, # mask 的大小 - pos_weight=-1, # 训练期间正样本的权重。 - debug=False)) # 是否设置调试模式。 - test_cfg = dict( # 用于测试 rpn 和 rcnn 超参数的配置 - rpn=dict( # 测试阶段生成 proposals 的配置 - nms_across_levels=False, # 是否对跨层的 box 做 NMS。仅适用于`GARPNHead`,naive rpn 不支持做 NMS cross levels。 - nms_pre=1000, # NMS 前的 box 数 - nms_post=1000, # NMS 要保留的 box 的数量,只在`GARPNHHead`中起作用。 - max_per_img=1000, # NMS 后要保留的 box 数量 - nms=dict( # NMS 的配置 - type='nms', # NMS 的类型 - iou_threshold=0.7 # NMS 阈值 - ), - min_bbox_size=0), # box 允许的最小尺寸 - rcnn=dict( # roi heads 的配置 - score_thr=0.05, # bbox 的分数阈值 - nms=dict( # 第二步的 NMS 配置 - type='nms', # NMS 的类型 - iou_thr=0.5), # NMS 的阈值 - max_per_img=100, # 每张图像的最大检测次数 - mask_thr_binary=0.5)) # mask 预处的阈值 +train_cfg = dict( # rpn 和 rcnn 训练超参数的配置 + rpn=dict( # rpn 的训练配置 + assigner=dict( # 分配器(assigner)的配置 + type='MaxIoUAssigner', # 分配器的类型,MaxIoUAssigner 用于许多常见的检测器,更多细节请参考 https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/assigners/max_iou_assigner.py#L10。 + pos_iou_thr=0.7, # IoU >= 0.7(阈值) 被视为正样本。 + neg_iou_thr=0.3, # IoU < 0.3(阈值) 被视为负样本。 + min_pos_iou=0.3, # 将框作为正样本的最小 IoU 阈值。 + match_low_quality=True, # 是否匹配低质量的框(更多细节见 API 文档). + ignore_iof_thr=-1), # 忽略 bbox 的 IoF 阈值。 + sampler=dict( # 正/负采样器(sampler)的配置 + type='RandomSampler', # 采样器类型,还支持 PseudoSampler 和其他采样器,更多细节请参考 https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/samplers/random_sampler.py#L8。 + num=256, # 样本数量。 + pos_fraction=0.5, # 正样本占总样本的比例。 + neg_pos_ub=-1, # 基于正样本数量的负样本上限。 + add_gt_as_proposals=False), # 采样后是否添加 GT 作为 proposal。 + allowed_border=-1, # 填充有效锚点后允许的边框。 + pos_weight=-1, # 训练期间正样本的权重。 + debug=False), # 是否设置调试(debug)模式 + rpn_proposal=dict( # 在训练期间生成 proposals 的配置 + nms_across_levels=False, # 是否对跨层的 box 做 NMS。仅适用于 `GARPNHead` ,naive rpn 不支持 nms cross levels。 + nms_pre=2000, # NMS 前的 box 数 + nms_post=1000, # NMS 要保留的 box 的数量,只在 GARPNHHead 中起作用。 + max_per_img=1000, # NMS 后要保留的 box 数量。 + nms=dict( # NMS 的配置 + type='nms', # NMS 的类别 + iou_threshold=0.7 # NMS 的阈值 + ), + min_bbox_size=0), # 允许的最小 box 尺寸 + rcnn=dict( # roi head 的配置。 + assigner=dict( # 第二阶段分配器的配置,这与 rpn 中的不同 + type='MaxIoUAssigner', # 分配器的类型,MaxIoUAssigner 目前用于所有 roi_heads。更多细节请参考 https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/assigners/max_iou_assigner.py#L10。 + pos_iou_thr=0.5, # IoU >= 0.5(阈值)被认为是正样本。 + neg_iou_thr=0.5, # IoU < 0.5(阈值)被认为是负样本。 + min_pos_iou=0.5, # 将 box 作为正样本的最小 IoU 阈值 + match_low_quality=False, # 是否匹配低质量下的 box(有关更多详细信息,请参阅 API 文档)。 + ignore_iof_thr=-1), # 忽略 bbox 的 IoF 阈值 + sampler=dict( + type='RandomSampler', #采样器的类型,还支持 PseudoSampler 和其他采样器,更多细节请参考 https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/bbox/samplers/random_sampler.py#L8。 + num=512, # 样本数量 + pos_fraction=0.25, # 正样本占总样本的比例。. + neg_pos_ub=-1, # 基于正样本数量的负样本上限。. + add_gt_as_proposals=True + ), # 采样后是否添加 GT 作为 proposal。 + mask_size=28, # mask 的大小 + pos_weight=-1, # 训练期间正样本的权重。 + debug=False)) # 是否设置调试模式。 +test_cfg = dict( # 用于测试 rpn 和 rcnn 超参数的配置 + rpn=dict( # 测试阶段生成 proposals 的配置 + nms_across_levels=False, # 是否对跨层的 box 做 NMS。仅适用于`GARPNHead`,naive rpn 不支持做 NMS cross levels。 + nms_pre=1000, # NMS 前的 box 数 + nms_post=1000, # NMS 要保留的 box 的数量,只在`GARPNHHead`中起作用。 + max_per_img=1000, # NMS 后要保留的 box 数量 + nms=dict( # NMS 的配置 + type='nms', # NMS 的类型 + iou_threshold=0.7 # NMS 阈值 + ), + min_bbox_size=0), # box 允许的最小尺寸 + rcnn=dict( # roi heads 的配置 + score_thr=0.05, # bbox 的分数阈值 + nms=dict( # 第二步的 NMS 配置 + type='nms', # NMS 的类型 + iou_thr=0.5), # NMS 的阈值 + max_per_img=100, # 每张图像的最大检测次数 + mask_thr_binary=0.5)) # mask 预处的阈值 dataset_type = 'CocoDataset' # 数据集类型,这将被用来定义数据集。 data_root = 'data/coco/' # 数据的根路径。 img_norm_cfg = dict( # 图像归一化配置,用来归一化输入的图像。 @@ -364,7 +364,7 @@ data = dict( ]) ], samples_per_gpu=2 # 单个 GPU 测试时的 Batch size - )) + )) evaluation = dict( # evaluation hook 的配置,更多细节请参考 https://github.com/open-mmlab/mmdetection/blob/master/mmdet/core/evaluation/eval_hooks.py#L7。 interval=1, # 验证的间隔。 metric=['bbox', 'segm']) # 验证期间使用的指标。 @@ -389,10 +389,15 @@ checkpoint_config = dict( # Checkpoint hook 的配置文件。执行时请参 interval=1) # 保存的间隔是 1。 log_config = dict( # register logger hook 的配置文件。 interval=50, # 打印日志的间隔 - hooks=[ - # dict(type='TensorboardLoggerHook') # 同样支持 Tensorboard 日志 - dict(type='TextLoggerHook') + hooks=[ # 训练期间执行的钩子 + dict(type='TextLoggerHook', by_epoch=False), + dict(type='TensorboardLoggerHook', by_epoch=False), + dict(type='MMDetWandbHook', by_epoch=False, # 还支持 Wandb 记录器,它需要安装 `wandb`。 + init_kwargs={'entity': "OpenMMLab", # 用于登录wandb的实体 + 'project': "MMDet", # WandB中的项目名称 + 'config': cfg_dict}), # 检查 https://docs.wandb.ai/ref/python/init 以获取更多初始化参数 ]) # 用于记录训练过程的记录器(logger)。 + dist_params = dict(backend='nccl') # 用于设置分布式训练的参数,端口也同样可被设置。 log_level = 'INFO' # 日志的级别。 load_from = None # 从一个给定路径里加载模型作为预训练模型,它并不会消耗训练时间。