简体中文 | English
PP-YOLO is a model of YOLOv3 optimized and improved by Baidu AI. The accuracy (COCO data set mAP) and reasoning speed given by Baidu are better than [YOLOv4] (https://arxiv.org/abs/2004.10934) model. COCO The accuracy of the test-dev2017 data set is 45.9%. The inference speed of FP32 is 72.9 FPS on the single card V100, and the inference speed of FP16 is 155.6 FPS when TensorRT is turned on on the V100.
second_drop_block=False
to keep it consistent with the original paper.yolo_loss_type=yolov5
, for details, please refer to the YOLOv5 chapter description, set to None to use the loss function definition defined by PP-YOLO, and set to yolov4 to use the original YOLO series loss function.Please download the ResNet50 pre-training model yourself
Download link: https://download.pytorch.org/models/resnet50-19c8e357.pth
Modify the configuration item pretrained=ResNet50 local storage location
type='PPYOLODetector',
pretrained='Local storage location of ResNet50 pre-training model',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=True),
norm_eval=True,
style='pytorch',
dcn=dict(type='DCNv2',deformable_groups=1, fallback_on_stride=False),
# dcn=None,
stage_with_dcn=(False, False, False, True)
)
Prepare the data set required for training by yourself, and specify the location of the data to be trained. For specific operations, please refer to 【here】 For data set preparation, please refer to the relevant chapters of yolov4, click 【here 】Arrive quickly.
python tools/train.py ${CONFIG_FILE}
If you want to specify the working directory in the command, you can add a parameter --work_dir ${YOUR_WORK_DIR}
.
python tools/train.py ${CONFIG_FILE} --device ${device} [optional arguments]
Optional parameters:
--validate
(strongly recommended): every time k during the training epoch (the default value is 1, you can modify this) to execute Evaluation.
--work_dir ${WORK_DIR}
: Overwrite the working directory specified in the configuration file.
--device ${device}
: assign cuda device , 0 or 0,1,2,3 or cpu,use all by default。
--resume_from ${CHECKPOINT_FILE}
: Resume training from the checkpoints file of previous training.
--multi-scale
: Multi-scale scaling, the size range is +/- 50% of the training image size
The difference between resume_from
and load_from
:
resume_from
loads the model weight and optimizer state, and the training continues from the specified checkpoint. It is usually used to resume training that was interrupted unexpectedly.
load_from
only loads model weights, and training starts from epoch 0. It is usually used for fine-tuning.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。