yolov5 训练速度对比

2023-02-22 11:02:52 浏览数 (1)

测试训练集二十几张图片,在m1 mac上的运行时间一共8.084 小时,共152 epochs。对于这个计算速度还是比较让人吃惊的,这个效率也太低了。对于需要处理图像的训练这个速度也无法让人接受。

代码语言:javascript复制
152 epochs completed in 8.084 hours.
Optimizer stripped from runs/train/exp3/weights/last.pt, 14.4MB
Optimizer stripped from runs/train/exp3/weights/best.pt, 14.4MB

wandb: Waiting for W&B process to finish, PID 63332
wandb: Program ended successfully.
wandb: Find user logs for this run at: /Users/zhongming/PycharmProjects/yolov5/wandb/offline-run-20210913_191626-18h6dxo0/logs/debug.log
wandb: Find internal logs for this run at: /Users/zhongming/PycharmProjects/yolov5/wandb/offline-run-20210913_191626-18h6dxo0/logs/debug-

下面是Win 10下的效果:

96 epochs completed in 0.014 hours.这个速度对比就明显了

代码语言:javascript复制
(E:anaconda_dirsvenvsyolov5-gpu) F:Pycharm_Projectsyolov5>python train_ads.py
train: weights=yolov5s.pt, cfg=, data=data/ads.yaml, hyp=data/hyps/hyp.scratch.yaml, epochs=300, batch_size=16, imgsz=640, rect=False, resume=False, nosave=False, noval=False, noautoanchor=False, evolve=None, bucket=, cache=None, image_weights=False, device=, multi_scale=False, single_cls=True, adam=False, sync_bn=False, workers=4, project=runs/train, entity=None, name=exp, exist_ok=False, quad=False, linear_lr=False, label_smoothing=0.0, upload_dataset=False, bbox_interval=-1, save_period=-1, artifact_alias=latest, local_rank=-1, freeze=0, patience=30
github: skipping check (offline), for updates see https://github.com/ultralytics/yolov5
YOLOv5 v5.0-405-gfad57c2 torch 1.9.0 CUDA:0 (NVIDIA GeForce RTX 3080, 10240.0MB)

hyperparameters: lr0=0.01, lrf=0.2, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=0.05, cls=0.5, cls_pw=1.0, obj=1.0, obj_pw=1.0, iou_t=0.2, anchor_t=4.0, fl_gamma=0.0, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.0, copy_paste=0.0
TensorBoard: Start with 'tensorboard --logdir runstrain', view at http://localhost:6006/
wandb: (1) Create a W&B account
wandb: (2) Use an existing W&B account
wandb: (3) Don't visualize my results
wandb: Enter your choice: 2
wandb: You chose 'Use an existing W&B account'
wandb: You can find your API key in your browser here: https://wandb.ai/authorize
wandb: Paste an API key from your profile and hit enter:
wandb: Appending key for api.wandb.ai to your netrc file: C:Usersobaby/.netrc
wandb: Tracking run with wandb version 0.12.1
wandb: Syncing run volcanic-shape-1
wandb: View project at https://wandb.ai/obaby/YOLOv5
wandb: View run at https://wandb.ai/obaby/YOLOv5/runs/3fb47yv2
wandb: Run data is saved locally in F:Pycharm_Projectsyolov5wandbrun-20210915_203301-3fb47yv2
wandb: Run `wandb offline` to turn off syncing.

Overriding model.yaml nc=80 with nc=1

from n params module arguments
0 -1 1 3520 models.common.Focus [3, 32, 3]
1 -1 1 18560 models.common.Conv [32, 64, 3, 2]
2 -1 1 18816 models.common.C3 [64, 64, 1]
3 -1 1 73984 models.common.Conv [64, 128, 3, 2]
4 -1 3 156928 models.common.C3 [128, 128, 3]
5 -1 1 295424 models.common.Conv [128, 256, 3, 2]
6 -1 3 625152 models.common.C3 [256, 256, 3]
7 -1 1 1180672 models.common.Conv [256, 512, 3, 2]
8 -1 1 656896 models.common.SPP [512, 512, [5, 9, 13]]
9 -1 1 1182720 models.common.C3 [512, 512, 1, False]
10 -1 1 131584 models.common.Conv [512, 256, 1, 1]
11 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest']
12 [-1, 6] 1 0 models.common.Concat [1]
13 -1 1 361984 models.common.C3 [512, 256, 1, False]
14 -1 1 33024 models.common.Conv [256, 128, 1, 1]
15 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest']
16 [-1, 4] 1 0 models.common.Concat [1]
17 -1 1 90880 models.common.C3 [256, 128, 1, False]
18 -1 1 147712 models.common.Conv [128, 128, 3, 2]
19 [-1, 14] 1 0 models.common.Concat [1]
20 -1 1 296448 models.common.C3 [256, 256, 1, False]
21 -1 1 590336 models.common.Conv [256, 256, 3, 2]
22 [-1, 10] 1 0 models.common.Concat [1]
23 -1 1 1182720 models.common.C3 [512, 512, 1, False]
24 [17, 20, 23] 1 16182 models.yolo.Detect [1, [[10, 13, 16, 30, 33, 23], [30, 61, 62, 45, 59, 119], [116, 90, 156, 198, 373, 326]], [128, 256, 512]]
Model Summary: 283 layers, 7063542 parameters, 7063542 gradients, 16.4 GFLOPs

Transferred 356/362 items from yolov5s.pt
Scaled weight_decay = 0.0005
optimizer: SGD with parameter groups 59 weight, 62 weight (no decay), 62 bias
train: Scanning 'datatrain.cache' images and labels... 16 found, 0 missing, 0 empty, 0 corrupted: 100%|█| 16/16 [00:00
val: Scanning 'dataval.cache' images and labels... 2 found, 0 missing, 0 empty, 0 corrupted: 100%|█| 2/2 [00:00<?, ?it
Plotting labels...

autoanchor: Analyzing anchors... anchors/target = 4.44, Best Possible Recall (BPR) = 1.0000
Image sizes 640 train, 640 val
Using 4 dataloader workers
Logging results to runstrainexp19
Starting training for 300 epochs...

Epoch gpu_mem box obj cls labels img_size
0/299 3.4G 0.1378 0.0201 0 28 640: 100%|████████████| 1/1 [00:04<00:00, 4.35s/it]
Class Images Labels P R mAP@.5 mAP@.5:.95: 100%|█| 1/1 [00:00<00:00, 28.65
all 2 0 0 0 0 0


Epoch gpu_mem box obj cls labels img_size
94/299 3.63G 0.06651 0.02039 0 27 640: 100%|████████████| 1/1 [00:00<00:00, 7.90it/s]
Class Images Labels P R mAP@.5 mAP@.5:.95: 100%|█| 1/1 [00:00<00:00, 35.77
all 2 2 0.137 0.5 0.0874 0.0514

Epoch gpu_mem box obj cls labels img_size
95/299 3.63G 0.06247 0.01776 0 22 640: 100%|████████████| 1/1 [00:00<00:00, 7.90it/s]
Class Images Labels P R mAP@.5 mAP@.5:.95: 100%|█| 1/1 [00:00<00:00, 37.14
all 2 2 0.171 0.427 0.104 0.0729
EarlyStopping patience 30 exceeded, stopping training.

96 epochs completed in 0.014 hours.
Optimizer stripped from runstrainexp19weightslast.pt, 14.4MB
Optimizer stripped from runstrainexp19weightsbest.pt, 14.4MB

wandb: Waiting for W&B process to finish, PID 13352
wandb: Program ended successfully.
wandb:
wandb: Find user logs for this run at: F:Pycharm_Projectsyolov5wandbrun-20210915_203301-3fb47yv2logsdebug.log
wandb: Find internal logs for this run at: F:Pycharm_Projectsyolov5wandbrun-20210915_203301-3fb47yv2logsdebug-internal.log
wandb: Run summary:
wandb: train/box_loss 0.06247
wandb: train/obj_loss 0.01776
wandb: train/cls_loss 0.0
wandb: metrics/precision 0.17077
wandb: metrics/recall 0.42693
wandb: metrics/mAP_0.5 0.10413
wandb: metrics/mAP_0.5:0.95 0.07289
wandb: val/box_loss 0.07609
wandb: val/obj_loss 0.02425
wandb: val/cls_loss 0.0
wandb: x/lr0 0.00078
wandb: x/lr1 0.00078
wandb: x/lr2 0.09128
wandb: _runtime 60
wandb: _timestamp 1631709241
wandb: _step 96
wandb: Run history:
wandb: train/box_loss █████▇▇▇▆▇▆▆▆▅▆▅▄▅▄▄▃▄▄▃▃▂▃▃▃▂▂▃▂▁▂▁▂▁▁▁
wandb: train/obj_loss ▅▅▅▄▃▃▅▃▄▄▃▂▃▁▄▃▅▃▅▃▅▂▄▆▅▅▄▄█▆▄▆▄▅▅▃▇█▅▅
wandb: train/cls_loss ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
wandb: metrics/precision ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▃▁▁▁▁█▁▆▁▂▂▁▁▁▁▃▅▄▃▃
wandb: metrics/recall ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█▁█████▇██████████████
wandb: metrics/mAP_0.5 ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▃▁▁▁▁█▁▆▁▂▂▁▁▂▂▃▄▃▃▃
wandb: metrics/mAP_0.5:0.95 ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▂▁▁▁▁▃▁█▁▁▁▁▁▁▂▃▅▄▅▅
wandb: val/box_loss ███████▇▇▇▇▇▆▇▆▆▆▅▅▅▄▄▅▄▃▃▄▃▃▃▃▄▃▂▃▂▁▁▁▁
wandb: val/obj_loss ▅▄▄▄▄▃▃▃▃▃▂▂▁▁▁▁▂▂▂▂▂▂▁▃▄▄▃▄▄▃▄▄▅▇▅▇▇▇██
wandb: val/cls_loss ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
wandb: x/lr0 ▁▁▁▂▂▂▂▃▃▃▃▃▄▄▄▄▄▅▅▅▅▅▆▆▆▆▆▆▇▇▇▇▇▇▇█████
wandb: x/lr1 ▁▁▁▂▂▂▂▃▃▃▃▃▄▄▄▄▄▅▅▅▅▅▆▆▆▆▆▆▇▇▇▇▇▇▇█████
wandb: x/lr2 ███▇▇▇▇▇▇▆▆▆▆▆▆▅▅▅▅▅▄▄▄▄▄▄▃▃▃▃▃▂▂▂▂▂▂▁▁▁
wandb: _runtime ▁▁▁▂▂▂▂▂▂▃▃▃▃▄▄▄▄▄▅▅▅▅▅▅▅▆▆▆▆▆▆▇▇▇▇▇▇▇██
wandb: _timestamp ▁▁▁▂▂▂▂▂▂▃▃▃▃▄▄▄▄▄▅▅▅▅▅▅▅▆▆▆▆▆▆▇▇▇▇▇▇▇██
wandb: _step ▁▁▁▂▂▂▂▂▂▃▃▃▃▃▃▄▄▄▄▄▅▅▅▅▅▅▆▆▆▆▆▇▇▇▇▇▇███
wandb:
wandb: Synced 6 W&B file(s), 18 media file(s), 1 artifact file(s) and 0 other file(s)
wandb:
wandb: Synced volcanic-shape-1: https://wandb.ai/obaby/YOLOv5/runs/3fb47yv2
Results saved to runstrainexp19

☆文章版权声明☆

* 网站名称:obaby@mars * 网址:https://h4ck.org.cn/ * 本文标题: 《yolov5 训练速度对比》 * 本文链接:https://h4ck.org.cn/2021/09/yolov5-训练速度对比/ * 转载文章请标明文章来源,原文标题以及原文链接。请遵从 《署名-非商业性使用-相同方式共享 2.5 中国大陆 (CC BY-NC-SA 2.5 CN) 》许可协议。


分享文章:

相关文章:

  1. Windows 10 yolov5 GPU环境
  2. Android Skip Ads Yolov5 Project
  3. 基于RandomForestClassifier的titanic生存概率分析
  4. Django admin Foreignkey ManyToMany list_display展示
  5. M1 Mac 安装Tensorflow
  6. 由apscheduler引发的django.db.utils.InternalError: (1054, u”Unknown column ‘rms.go_datetime’ in ‘field list'”)
  7. iMessageDebug Mode
  8. Django REST framework foreignkey 序列化
  9. ubuntu uwsgi No module named ‘django’
  10. django使用多个数据库

0 人点赞