私的AI研究会 > YOLOv7_Colab5
さらに別の「じゃんけん(グー・チョキ・パー)」のカスタム・データセットを作成し、Google Colaboratory 上の「YOLO V7」を使用して学習モデルを作成、「じゃんけん(グー・チョキ・パー)」の検出精度の向上を試みる。
(py38a) PS > cd /anaconda_win/work/labelImg/janken3/ ← janken3の場合 (py38a) PS > cd /anaconda_win/work/labelImg/janken4/ ← janken4の場合
(py38a) PS > labelImg par predefined_classes.txt par ← per のラベリングの場合 (py38a) PS > labelImg choki predefined_classes.txt choki ← choki のラベリングの場合 (py38a) PS > labelImg goo predefined_classes.txt goo ← goo のラベリングの場合
janken3_dataset → データセット フォルダ (janken3_dataset/janken4_dataset) │ ├─ train → トレーニング用データ フォルダ │ ├─ images → 画像フォルダ │ │ ├─ XXXXXXX.jpg → 画像ファイル │ ︙ ︙ │ │ │ └─ labels → ラベル フォルダ │ ├─ XXXXXXX.txt → ラベルファイル │ ︙ │ ├─ varid → 学習状況の検証用データフォルダ │ ├─ images → 画像フォルダ │ │ ├─ XXXXXXX.jpg → 画像ファイル ︙ ︙ ︙ │ │ │ └─ labels → ラベル フォルダ │ ├─ XXXXXXX.txt → ラベルファイル ︙ ︙ ├─ class.txt → クラス分類(参考) └─ janken_dataset2.yaml → データセットの構成ファイル
# -*- coding: utf-8 -*- ##------------------------------------------ ## File select Ver 0.03 ## ## 2023.08.08 Masahiro Izutsu ##------------------------------------------ ## file_select3.py import random import shutil import glob import os import sys # 重複なし乱数 # in: a から b までの整数 を k 個 # out: 整数のリスト def rand_ints_nodup(a, b, k): ns = [] while len(ns) < k: n = random.randint(a, b) if not n in ns: ns.append(n) return ns # 抽出ファイル名のリスト # in: folder フォルダへのパス # out: 整数のリスト def get_select_file(ns, folder): files = sorted(glob.glob(folder + '/*.jpg')) ss = [] for file in files: s0 = os.path.splitext(os.path.basename(file))[0] ss.append(s0) s = [] nm = len(ns) for n in range(nm): s.append(ss[ns[n]]) return s #-----Main routine----- # python file_select3.py [1] []:ファイル移動(1=あり) # if __name__ == "__main__": args = sys.argv fmove = False if len(args) <= 1 or args[1] != '1' else True sel_no = 40 max_no = 200 s_path = 'janken4/' d0_path = 'janken4_dataset/valid/images/' d1_path = 'janken4_dataset/valid/labels/' # ランダムに抽出 ns = rand_ints_nodup(0, max_no -1, sel_no) goo = get_select_file(ns, s_path + 'goo') ns = rand_ints_nodup(0, max_no - 1, sel_no) choki = get_select_file(ns, s_path + 'choki') ns = rand_ints_nodup(0, max_no - 1, sel_no) par = get_select_file(ns, s_path + 'par') # ファイル移動 for n in range(sel_no): s0_f = s_path + 'goo/' + goo[n] + '.jpg' print(s0_f, '>>', d0_path) if fmove: shutil.move(s0_f, d0_path) s1_f = s_path + 'goo/' + goo[n] + '.txt' d1_f = d1_path + goo[n] print(s1_f, '>>', d1_path) if fmove: shutil.move(s1_f, d1_path) s0_f = s_path + 'choki/' + choki[n] + '.jpg' print(s0_f, '>>', d0_path) if fmove: shutil.move(s0_f, d0_path) s1_f = s_path + 'choki/' + choki[n] + '.txt' print(s1_f, '>>', d1_path) if fmove: shutil.move(s1_f, d1_path) s0_f = s_path + 'par/' + par[n] + '.jpg' print(s0_f, '>>', d0_path) if fmove: shutil.move(s0_f, d0_path) s1_f = s_path + 'par/' + par[n] + '.txt' print(s1_f, '>>', d1_path) if fmove: shutil.move(s1_f, d1_path) print(n) print('file move:', fmove) print('-- End ---')
train: ./data/janken_dataset4/train/images または train: ./data/janken_dataset3/train/images val: ./data/janken_dataset4/valid/images または val: ./data/janken_dataset3/valid/images nc: 3 names: ['goo', 'choki', 'par']
yolov7 ┗ data ┠ janken3_dataset ┗ janken4_dataset
yolov7 ┠ data ┃ ┠ janken3_dataset ┃ ┗ janken4_dataset ┠ janken3_dataset.yaml ┗ janken4_dataset.yaml
cd /content/drive/MyDrive/yolov7
/content/drive/MyDrive/yolov7
!python train.py --workers 8 --batch-size 16 --data janken4_dataset.yaml --cfg cfg/training/yolov7x.yaml --weights 'yolov7x.pt' --name yolov7x_custom4_60 --hyp data/hyp.scratch.p5.yaml --epochs 60 --device 0
2023-08-09 06:16:33.538327: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: AVX2 AVX512F FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. 2023-08-09 06:16:34.397886: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT YOLOR 🚀 v0.1-122-g3b41c2c torch 2.0.1+cu118 CUDA:0 (Tesla T4, 15101.8125MB) Namespace(weights='yolov7x.pt', cfg='cfg/training/yolov7x.yaml', data='janken4_dataset.yaml', hyp='data/hyp.scratch.p5.yaml', epochs=60, batch_size=16, img_size=[640, 640], rect=False, resume=False, nosave=False, notest=False, noautoanchor=False, evolve=False, bucket='', cache_images=False, image_weights=False, device='0', multi_scale=False, single_cls=False, adam=False, sync_bn=False, local_rank=-1, workers=8, project='runs/train', entity=None, name='yolov7x_custom4_60', exist_ok=False, quad=False, linear_lr=False, label_smoothing=0.0, upload_dataset=False, bbox_interval=-1, save_period=-1, artifact_alias='latest', freeze=[0], v5_metric=False, world_size=1, global_rank=-1, save_dir='runs/train/yolov7x_custom4_60', total_batch_size=16) tensorboard: Start with 'tensorboard --logdir runs/train', view at http://localhost:6006/ hyperparameters: lr0=0.01, lrf=0.1, 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.3, cls_pw=1.0, obj=0.7, 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.2, scale=0.9, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.15, copy_paste=0.0, paste_in=0.15, loss_ota=1 wandb: Install Weights & Biases for YOLOR logging with 'pip install wandb' (recommended) Overriding model.yaml nc=80 with nc=3 from n params module arguments 0 -1 1 1160 models.common.Conv [3, 40, 3, 1] 1 -1 1 28960 models.common.Conv [40, 80, 3, 2] 2 -1 1 57760 models.common.Conv [80, 80, 3, 1] 3 -1 1 115520 models.common.Conv [80, 160, 3, 2] 4 -1 1 10368 models.common.Conv [160, 64, 1, 1] 5 -2 1 10368 models.common.Conv [160, 64, 1, 1] 6 -1 1 36992 models.common.Conv [64, 64, 3, 1] 7 -1 1 36992 models.common.Conv [64, 64, 3, 1] 8 -1 1 36992 models.common.Conv [64, 64, 3, 1] 9 -1 1 36992 models.common.Conv [64, 64, 3, 1] 10 -1 1 36992 models.common.Conv [64, 64, 3, 1] 11 -1 1 36992 models.common.Conv [64, 64, 3, 1] 12[-1, -3, -5, -7, -8] 1 0 models.common.Concat [1] 13 -1 1 103040 models.common.Conv [320, 320, 1, 1] 14 -1 1 0 models.common.MP [] 15 -1 1 51520 models.common.Conv [320, 160, 1, 1] 16 -3 1 51520 models.common.Conv [320, 160, 1, 1] 17 -1 1 230720 models.common.Conv [160, 160, 3, 2] 18 [-1, -3] 1 0 models.common.Concat [1] 19 -1 1 41216 models.common.Conv [320, 128, 1, 1] 20 -2 1 41216 models.common.Conv [320, 128, 1, 1] 21 -1 1 147712 models.common.Conv [128, 128, 3, 1] 22 -1 1 147712 models.common.Conv [128, 128, 3, 1] 23 -1 1 147712 models.common.Conv [128, 128, 3, 1] 24 -1 1 147712 models.common.Conv [128, 128, 3, 1] 25 -1 1 147712 models.common.Conv [128, 128, 3, 1] 26 -1 1 147712 models.common.Conv [128, 128, 3, 1] 27[-1, -3, -5, -7, -8] 1 0 models.common.Concat [1] 28 -1 1 410880 models.common.Conv [640, 640, 1, 1] 29 -1 1 0 models.common.MP [] 30 -1 1 205440 models.common.Conv [640, 320, 1, 1] 31 -3 1 205440 models.common.Conv [640, 320, 1, 1] 32 -1 1 922240 models.common.Conv [320, 320, 3, 2] 33 [-1, -3] 1 0 models.common.Concat [1] 34 -1 1 164352 models.common.Conv [640, 256, 1, 1] 35 -2 1 164352 models.common.Conv [640, 256, 1, 1] 36 -1 1 590336 models.common.Conv [256, 256, 3, 1] 37 -1 1 590336 models.common.Conv [256, 256, 3, 1] 38 -1 1 590336 models.common.Conv [256, 256, 3, 1] 39 -1 1 590336 models.common.Conv [256, 256, 3, 1] 40 -1 1 590336 models.common.Conv [256, 256, 3, 1] 41 -1 1 590336 models.common.Conv [256, 256, 3, 1] 42[-1, -3, -5, -7, -8] 1 0 models.common.Concat [1] 43 -1 1 1640960 models.common.Conv [1280, 1280, 1, 1] 44 -1 1 0 models.common.MP [] 45 -1 1 820480 models.common.Conv [1280, 640, 1, 1] 46 -3 1 820480 models.common.Conv [1280, 640, 1, 1] 47 -1 1 3687680 models.common.Conv [640, 640, 3, 2] 48 [-1, -3] 1 0 models.common.Concat [1] 49 -1 1 328192 models.common.Conv [1280, 256, 1, 1] 50 -2 1 328192 models.common.Conv [1280, 256, 1, 1] 51 -1 1 590336 models.common.Conv [256, 256, 3, 1] 52 -1 1 590336 models.common.Conv [256, 256, 3, 1] 53 -1 1 590336 models.common.Conv [256, 256, 3, 1] 54 -1 1 590336 models.common.Conv [256, 256, 3, 1] 55 -1 1 590336 models.common.Conv [256, 256, 3, 1] 56 -1 1 590336 models.common.Conv [256, 256, 3, 1] 57[-1, -3, -5, -7, -8] 1 0 models.common.Concat [1] 58 -1 1 1640960 models.common.Conv [1280, 1280, 1, 1] 59 -1 1 11887360 models.common.SPPCSPC [1280, 640, 1] 60 -1 1 205440 models.common.Conv [640, 320, 1, 1] 61 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] 62 43 1 410240 models.common.Conv [1280, 320, 1, 1] 63 [-1, -2] 1 0 models.common.Concat [1] 64 -1 1 164352 models.common.Conv [640, 256, 1, 1] 65 -2 1 164352 models.common.Conv [640, 256, 1, 1] 66 -1 1 590336 models.common.Conv [256, 256, 3, 1] 67 -1 1 590336 models.common.Conv [256, 256, 3, 1] 68 -1 1 590336 models.common.Conv [256, 256, 3, 1] 69 -1 1 590336 models.common.Conv [256, 256, 3, 1] 70 -1 1 590336 models.common.Conv [256, 256, 3, 1] 71 -1 1 590336 models.common.Conv [256, 256, 3, 1] 72[-1, -3, -5, -7, -8] 1 0 models.common.Concat [1] 73 -1 1 410240 models.common.Conv [1280, 320, 1, 1] 74 -1 1 51520 models.common.Conv [320, 160, 1, 1] 75 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] 76 28 1 102720 models.common.Conv [640, 160, 1, 1] 77 [-1, -2] 1 0 models.common.Concat [1] 78 -1 1 41216 models.common.Conv [320, 128, 1, 1] 79 -2 1 41216 models.common.Conv [320, 128, 1, 1] 80 -1 1 147712 models.common.Conv [128, 128, 3, 1] 81 -1 1 147712 models.common.Conv [128, 128, 3, 1] 82 -1 1 147712 models.common.Conv [128, 128, 3, 1] 83 -1 1 147712 models.common.Conv [128, 128, 3, 1] 84 -1 1 147712 models.common.Conv [128, 128, 3, 1] 85 -1 1 147712 models.common.Conv [128, 128, 3, 1] 86[-1, -3, -5, -7, -8] 1 0 models.common.Concat [1] 87 -1 1 102720 models.common.Conv [640, 160, 1, 1] 88 -1 1 0 models.common.MP [] 89 -1 1 25920 models.common.Conv [160, 160, 1, 1] 90 -3 1 25920 models.common.Conv [160, 160, 1, 1] 91 -1 1 230720 models.common.Conv [160, 160, 3, 2] 92 [-1, -3, 73] 1 0 models.common.Concat [1] 93 -1 1 164352 models.common.Conv [640, 256, 1, 1] 94 -2 1 164352 models.common.Conv [640, 256, 1, 1] 95 -1 1 590336 models.common.Conv [256, 256, 3, 1] 96 -1 1 590336 models.common.Conv [256, 256, 3, 1] 97 -1 1 590336 models.common.Conv [256, 256, 3, 1] 98 -1 1 590336 models.common.Conv [256, 256, 3, 1] 99 -1 1 590336 models.common.Conv [256, 256, 3, 1] 100 -1 1 590336 models.common.Conv [256, 256, 3, 1] 101[-1, -3, -5, -7, -8] 1 0 models.common.Concat [1] 102 -1 1 410240 models.common.Conv [1280, 320, 1, 1] 103 -1 1 0 models.common.MP [] 104 -1 1 103040 models.common.Conv [320, 320, 1, 1] 105 -3 1 103040 models.common.Conv [320, 320, 1, 1] 106 -1 1 922240 models.common.Conv [320, 320, 3, 2] 107 [-1, -3, 59] 1 0 models.common.Concat [1] 108 -1 1 656384 models.common.Conv [1280, 512, 1, 1] 109 -2 1 656384 models.common.Conv [1280, 512, 1, 1] 110 -1 1 2360320 models.common.Conv [512, 512, 3, 1] 111 -1 1 2360320 models.common.Conv [512, 512, 3, 1] 112 -1 1 2360320 models.common.Conv [512, 512, 3, 1] 113 -1 1 2360320 models.common.Conv [512, 512, 3, 1] 114 -1 1 2360320 models.common.Conv [512, 512, 3, 1] 115 -1 1 2360320 models.common.Conv [512, 512, 3, 1] 116[-1, -3, -5, -7, -8] 1 0 models.common.Concat [1] 117 -1 1 1639680 models.common.Conv [2560, 640, 1, 1] 118 87 1 461440 models.common.Conv [160, 320, 3, 1] 119 102 1 1844480 models.common.Conv [320, 640, 3, 1] 120 117 1 7375360 models.common.Conv [640, 1280, 3, 1] 121 [118, 119, 120] 1 56144 models.yolo.IDetect [3, [[12, 16, 19, 36, 40, 28], [36, 75, 76, 55, 72, 146], [142, 110, 192, 243, 459, 401]], [320, 640, 1280]] Model Summary: 467 layers, 70828568 parameters, 70828568 gradients Transferred 630/644 items from yolov7x.pt Scaled weight_decay = 0.0005 Optimizer groups: 108 .bias, 108 conv.weight, 111 other train: Scanning 'data/janken4_dataset/train/labels' images and labels... 480 found, 0 missing, 0 empty, 0 corrupted: 100% 480/480 [04:45<00:00, 1.68it/s] train: New cache created: data/janken4_dataset/train/labels.cache val: Scanning 'data/janken4_dataset/valid/labels' images and labels... 120 found, 0 missing, 0 empty, 0 corrupted: 100% 120/120 [01:12<00:00, 1.66it/s] val: New cache created: data/janken4_dataset/valid/labels.cache autoanchor: Analyzing anchors... anchors/target = 3.61, Best Possible Recall (BPR) = 1.0000 Image sizes 640 train, 640 test Using 2 dataloader workers Logging results to runs/train/yolov7x_custom4_60 Starting training for 60 epochs... Epoch gpu_mem box obj cls total labels img_size 0/59 14.3G 0.06725 0.01966 0.02206 0.109 37 640: 100% 30/30 [01:06<00:00, 2.22s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 0% 0/4 [00:00<?, ?it/s]/usr/local/lib/python3.10/dist-packages/torch/functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3483.) return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:15<00:00, 3.80s/it] all 120 120 0.065 0.142 0.0587 0.0119 Epoch gpu_mem box obj cls total labels img_size 1/59 14.3G 0.05622 0.01661 0.02124 0.09407 46 640: 100% 30/30 [00:49<00:00, 1.65s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:04<00:00, 1.14s/it] all 120 120 0.169 0.317 0.162 0.0554 Epoch gpu_mem box obj cls total labels img_size 2/59 14.3G 0.05096 0.01517 0.02084 0.08697 48 640: 100% 30/30 [00:45<00:00, 1.53s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.33it/s] all 120 120 0.133 0.408 0.233 0.076 Epoch gpu_mem box obj cls total labels img_size 3/59 14.3G 0.05101 0.01428 0.0195 0.0848 68 640: 100% 30/30 [00:44<00:00, 1.50s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.40it/s] all 120 120 0.3 0.483 0.314 0.126 Epoch gpu_mem box obj cls total labels img_size 4/59 14.3G 0.04852 0.01187 0.01825 0.07864 42 640: 100% 30/30 [00:44<00:00, 1.49s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.45it/s] all 120 120 0.488 0.455 0.406 0.174 Epoch gpu_mem box obj cls total labels img_size 5/59 14.3G 0.04439 0.01092 0.01619 0.0715 37 640: 100% 30/30 [00:45<00:00, 1.51s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.23it/s] all 120 120 0.489 0.7 0.586 0.242 Epoch gpu_mem box obj cls total labels img_size 6/59 14.3G 0.04978 0.01041 0.01772 0.07792 36 640: 100% 30/30 [00:45<00:00, 1.51s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:04<00:00, 1.10s/it] all 120 120 0.579 0.617 0.631 0.276 Epoch gpu_mem box obj cls total labels img_size 7/59 14.4G 0.04325 0.009604 0.01549 0.06834 52 640: 100% 30/30 [00:43<00:00, 1.46s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.41it/s] all 120 120 0.51 0.725 0.599 0.25 Epoch gpu_mem box obj cls total labels img_size 8/59 14.4G 0.04635 0.009091 0.01466 0.0701 50 640: 100% 30/30 [00:42<00:00, 1.41s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.60it/s] all 120 120 0.573 0.915 0.737 0.433 Epoch gpu_mem box obj cls total labels img_size 9/59 14.4G 0.04379 0.008973 0.01532 0.06808 40 640: 100% 30/30 [00:42<00:00, 1.42s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.27it/s] all 120 120 0.55 0.808 0.766 0.401 Epoch gpu_mem box obj cls total labels img_size 10/59 14.4G 0.04375 0.009017 0.01527 0.06804 44 640: 100% 30/30 [00:42<00:00, 1.43s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.32it/s] all 120 120 0.613 0.735 0.62 0.36 Epoch gpu_mem box obj cls total labels img_size 11/59 14.4G 0.04646 0.008779 0.01594 0.07118 56 640: 100% 30/30 [00:42<00:00, 1.42s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.11it/s] all 120 120 0.492 0.833 0.618 0.292 Epoch gpu_mem box obj cls total labels img_size 12/59 14.4G 0.03823 0.008449 0.01409 0.06077 47 640: 100% 30/30 [00:40<00:00, 1.36s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.28it/s] all 120 120 0.653 0.681 0.685 0.342 Epoch gpu_mem box obj cls total labels img_size 13/59 14.4G 0.04473 0.008212 0.01547 0.06841 37 640: 100% 30/30 [00:41<00:00, 1.38s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.47it/s] all 120 120 0.0114 0.517 0.00624 0.00112 Epoch gpu_mem box obj cls total labels img_size 14/59 14.4G 0.03779 0.008591 0.0143 0.06069 45 640: 100% 30/30 [00:42<00:00, 1.43s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.26it/s] all 120 120 0.456 0.483 0.409 0.188 Epoch gpu_mem box obj cls total labels img_size 15/59 14.4G 0.03845 0.008096 0.0132 0.05975 48 640: 100% 30/30 [00:41<00:00, 1.37s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.24it/s] all 120 120 0.482 0.558 0.456 0.228 Epoch gpu_mem box obj cls total labels img_size 16/59 14.4G 0.0371 0.008425 0.01386 0.05939 54 640: 100% 30/30 [00:41<00:00, 1.38s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.06it/s] all 120 120 0.00416 0.458 0.00223 0.000376 Epoch gpu_mem box obj cls total labels img_size 17/59 14.3G 0.03793 0.008862 0.01433 0.06112 59 640: 100% 30/30 [00:41<00:00, 1.37s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.45it/s] all 120 120 0.00899 0.167 0.00308 0.000502 Epoch gpu_mem box obj cls total labels img_size 18/59 14.3G 0.04067 0.009869 0.0158 0.06634 41 640: 100% 30/30 [00:41<00:00, 1.39s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.55it/s] all 120 120 0.00328 0.0667 0.00095 0.000123 Epoch gpu_mem box obj cls total labels img_size 19/59 14.3G 0.04454 0.009504 0.01611 0.07015 35 640: 100% 30/30 [00:42<00:00, 1.42s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.44it/s] all 120 120 0.034 0.267 0.0208 0.00391 Epoch gpu_mem box obj cls total labels img_size 20/59 14.3G 0.0448 0.008806 0.0155 0.06911 45 640: 100% 30/30 [00:40<00:00, 1.36s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.11it/s] all 120 120 0.0813 0.1 0.0542 0.0171 Epoch gpu_mem box obj cls total labels img_size 21/59 14.3G 0.04207 0.009518 0.01489 0.06648 50 640: 100% 30/30 [00:41<00:00, 1.38s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.59it/s] all 120 120 0.354 0.025 0.0054 0.00142 Epoch gpu_mem box obj cls total labels img_size 22/59 14.3G 0.03842 0.008459 0.01443 0.06131 41 640: 100% 30/30 [00:42<00:00, 1.42s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.50it/s] all 120 120 0.498 0.689 0.589 0.322 Epoch gpu_mem box obj cls total labels img_size 23/59 14.3G 0.03608 0.008739 0.01333 0.05815 50 640: 100% 30/30 [00:40<00:00, 1.36s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.61it/s] all 120 120 0.00655 0.275 0.00422 0.000648 Epoch gpu_mem box obj cls total labels img_size 24/59 14.3G 0.04381 0.008793 0.01462 0.06723 56 640: 100% 30/30 [00:41<00:00, 1.40s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.10it/s] all 120 120 0.0795 0.441 0.0639 0.0171 Epoch gpu_mem box obj cls total labels img_size 25/59 14.3G 0.04059 0.008731 0.01502 0.06434 44 640: 100% 30/30 [00:42<00:00, 1.40s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.34it/s] all 120 120 0.309 0.433 0.276 0.12 Epoch gpu_mem box obj cls total labels img_size 26/59 14.3G 0.03809 0.009129 0.01386 0.06107 45 640: 100% 30/30 [00:40<00:00, 1.37s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.60it/s] all 120 120 0.739 0.591 0.664 0.366 Epoch gpu_mem box obj cls total labels img_size 27/59 14.3G 0.03615 0.008456 0.01307 0.05767 46 640: 100% 30/30 [00:42<00:00, 1.43s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.34it/s] all 120 120 0.136 0.375 0.085 0.0233 Epoch gpu_mem box obj cls total labels img_size 28/59 14.3G 0.04433 0.008695 0.01442 0.06744 54 640: 100% 30/30 [00:40<00:00, 1.36s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.53it/s] all 120 120 0.516 0.498 0.442 0.262 Epoch gpu_mem box obj cls total labels img_size 29/59 14.3G 0.04083 0.008526 0.01321 0.06257 49 640: 100% 30/30 [00:42<00:00, 1.42s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.09it/s] all 120 120 0.686 0.542 0.662 0.376 Epoch gpu_mem box obj cls total labels img_size 30/59 14.3G 0.0327 0.00811 0.01128 0.05209 22 640: 100% 30/30 [00:41<00:00, 1.39s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.21it/s] all 120 120 0.854 0.833 0.897 0.581 Epoch gpu_mem box obj cls total labels img_size 31/59 14.3G 0.03687 0.008103 0.01151 0.05648 57 640: 100% 30/30 [00:42<00:00, 1.41s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.41it/s] all 120 120 0.786 0.868 0.899 0.544 Epoch gpu_mem box obj cls total labels img_size 32/59 14.3G 0.03736 0.007856 0.01301 0.05822 51 640: 100% 30/30 [00:43<00:00, 1.44s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.46it/s] all 120 120 0.49 0.424 0.401 0.181 Epoch gpu_mem box obj cls total labels img_size 33/59 14.3G 0.03893 0.008276 0.01222 0.05943 48 640: 100% 30/30 [00:41<00:00, 1.39s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.47it/s] all 120 120 0.287 0.533 0.37 0.213 Epoch gpu_mem box obj cls total labels img_size 34/59 14.3G 0.03874 0.007999 0.01332 0.06005 44 640: 100% 30/30 [00:42<00:00, 1.42s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.58it/s] all 120 120 0.808 0.665 0.757 0.485 Epoch gpu_mem box obj cls total labels img_size 35/59 14.3G 0.03248 0.008513 0.01119 0.05219 44 640: 100% 30/30 [00:41<00:00, 1.37s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.44it/s] all 120 120 0.862 0.88 0.924 0.577 Epoch gpu_mem box obj cls total labels img_size 36/59 14.3G 0.03217 0.007849 0.01136 0.05138 47 640: 100% 30/30 [00:41<00:00, 1.40s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.64it/s] all 120 120 0.962 0.942 0.978 0.665 Epoch gpu_mem box obj cls total labels img_size 37/59 14.3G 0.03081 0.008316 0.00997 0.04909 33 640: 100% 30/30 [00:42<00:00, 1.43s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.30it/s] all 120 120 0.932 0.922 0.939 0.615 Epoch gpu_mem box obj cls total labels img_size 38/59 14.3G 0.036 0.007643 0.01115 0.05479 39 640: 100% 30/30 [00:41<00:00, 1.39s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.52it/s] all 120 120 0.981 0.908 0.976 0.709 Epoch gpu_mem box obj cls total labels img_size 39/59 14.3G 0.02868 0.007927 0.009863 0.04647 57 640: 100% 30/30 [00:41<00:00, 1.40s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.15it/s] all 120 120 0.913 0.908 0.948 0.685 Epoch gpu_mem box obj cls total labels img_size 40/59 14.3G 0.02881 0.007813 0.009581 0.0462 41 640: 100% 30/30 [00:41<00:00, 1.37s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.41it/s] all 120 120 0.992 0.933 0.989 0.71 Epoch gpu_mem box obj cls total labels img_size 41/59 14.3G 0.02769 0.007723 0.008994 0.04441 51 640: 100% 30/30 [00:42<00:00, 1.42s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.43it/s] all 120 120 0.987 0.958 0.991 0.732 Epoch gpu_mem box obj cls total labels img_size 42/59 14.3G 0.02691 0.007476 0.00907 0.04346 38 640: 100% 30/30 [00:42<00:00, 1.42s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:04<00:00, 1.02s/it] all 120 120 0.97 0.974 0.99 0.716 Epoch gpu_mem box obj cls total labels img_size 43/59 14.3G 0.02959 0.00723 0.009153 0.04597 48 640: 100% 30/30 [00:41<00:00, 1.38s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.10it/s] all 120 120 0.957 0.95 0.987 0.725 Epoch gpu_mem box obj cls total labels img_size 44/59 14.3G 0.0275 0.007669 0.00849 0.04366 53 640: 100% 30/30 [00:42<00:00, 1.41s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.47it/s] all 120 120 0.954 0.958 0.988 0.731 Epoch gpu_mem box obj cls total labels img_size 45/59 14.3G 0.02923 0.007207 0.009109 0.04554 47 640: 100% 30/30 [00:41<00:00, 1.39s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.51it/s] all 120 120 0.971 0.958 0.988 0.725 Epoch gpu_mem box obj cls total labels img_size 46/59 14.3G 0.02525 0.007215 0.007669 0.04013 38 640: 100% 30/30 [00:41<00:00, 1.37s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.51it/s] all 120 120 0.99 0.936 0.99 0.735 Epoch gpu_mem box obj cls total labels img_size 47/59 14.3G 0.03294 0.007088 0.009275 0.0493 36 640: 100% 30/30 [00:41<00:00, 1.38s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:04<00:00, 1.06s/it] all 120 120 0.889 0.731 0.794 0.556 Epoch gpu_mem box obj cls total labels img_size 48/59 14.3G 0.03111 0.007519 0.008361 0.04699 54 640: 100% 30/30 [00:44<00:00, 1.48s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.26it/s] all 120 120 0.963 0.975 0.99 0.738 Epoch gpu_mem box obj cls total labels img_size 49/59 14.3G 0.03291 0.007196 0.009421 0.04953 41 640: 100% 30/30 [00:43<00:00, 1.45s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.62it/s] all 120 120 1 0.94 0.991 0.737 Epoch gpu_mem box obj cls total labels img_size 50/59 14.3G 0.03182 0.007212 0.009085 0.04811 51 640: 100% 30/30 [00:42<00:00, 1.41s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.17it/s] all 120 120 0.978 0.958 0.989 0.726 Epoch gpu_mem box obj cls total labels img_size 51/59 14.3G 0.02781 0.007255 0.008328 0.0434 63 640: 100% 30/30 [00:41<00:00, 1.38s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.40it/s] all 120 120 0.98 0.975 0.991 0.736 Epoch gpu_mem box obj cls total labels img_size 52/59 14.3G 0.02127 0.006824 0.00691 0.03501 39 640: 100% 30/30 [00:40<00:00, 1.36s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.33it/s] all 120 120 0.976 0.981 0.992 0.74 Epoch gpu_mem box obj cls total labels img_size 53/59 14.3G 0.03021 0.00682 0.008502 0.04553 42 640: 100% 30/30 [00:44<00:00, 1.49s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.24it/s] all 120 120 0.981 0.98 0.99 0.739 Epoch gpu_mem box obj cls total labels img_size 54/59 14.3G 0.02368 0.007174 0.007572 0.03842 45 640: 100% 30/30 [00:41<00:00, 1.38s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.54it/s] all 120 120 0.955 0.967 0.987 0.741 Epoch gpu_mem box obj cls total labels img_size 55/59 14.3G 0.02867 0.006861 0.008515 0.04404 45 640: 100% 30/30 [00:43<00:00, 1.45s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.44it/s] all 120 120 0.982 0.975 0.991 0.739 Epoch gpu_mem box obj cls total labels img_size 56/59 14.3G 0.02611 0.006984 0.007685 0.04078 39 640: 100% 30/30 [00:41<00:00, 1.39s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.17it/s] all 120 120 0.964 0.971 0.988 0.742 Epoch gpu_mem box obj cls total labels img_size 57/59 14.3G 0.02857 0.007169 0.008503 0.04424 44 640: 100% 30/30 [00:43<00:00, 1.45s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.37it/s] all 120 120 0.981 0.966 0.99 0.741 Epoch gpu_mem box obj cls total labels img_size 58/59 14.3G 0.02516 0.006754 0.007626 0.03954 44 640: 100% 30/30 [00:46<00:00, 1.56s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.51it/s] all 120 120 0.981 0.981 0.99 0.743 Epoch gpu_mem box obj cls total labels img_size 59/59 14.3G 0.03125 0.006811 0.009357 0.04742 42 640: 100% 30/30 [00:44<00:00, 1.50s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.10it/s] all 120 120 0.977 0.983 0.991 0.747 goo 120 40 0.988 1 0.995 0.702 choki 120 40 0.975 0.975 0.985 0.707 par 120 40 0.968 0.975 0.992 0.832 60 epochs completed in 0.854 hours. Optimizer stripped from runs/train/yolov7x_custom4_60/weights/last.pt, 142.1MB Optimizer stripped from runs/train/yolov7x_custom4_60/weights/best.pt, 142.1MB
!pip install onnx
Collecting onnx Downloading onnx-1.14.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.6 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14.6/14.6 MB 62.0 MB/s eta 0:00:00 Requirement already satisfied: numpy in /usr/local/lib/python3.10/dist-packages (from onnx) (1.23.5) Requirement already satisfied: protobuf>=3.20.2 in /usr/local/lib/python3.10/dist-packages (from onnx) (3.20.3) Requirement already satisfied: typing-extensions>=3.6.2.1 in /usr/local/lib/python3.10/dist-packages (from onnx) (4.7.1) Installing collected packages: onnx Successfully installed onnx-1.14.0
!python export.py --weights runs/train/yolov7x_custom4_60/weights/best.pt
Import onnx_graphsurgeon failure: No module named 'onnx_graphsurgeon' Namespace(weights='runs/train/yolov7x_custom4_60/weights/best.pt', img_size=[640, 640], batch_size=1, dynamic=False, dynamic_batch=False, grid=False, end2end=False, max_wh=None, topk_all=100, iou_thres=0.45, conf_thres=0.25, device='cpu', simplify=False, include_nms=False, fp16=False, int8=False) YOLOR 🚀 v0.1-122-g3b41c2c torch 2.0.1+cu118 CPU Fusing layers... IDetect.fuse Model Summary: 362 layers, 70795920 parameters, 0 gradients Starting TorchScript export with torch 2.0.1+cu118... TorchScript export success, saved as runs/train/yolov7x_custom4_60/weights/best.torchscript.pt CoreML export failure: No module named 'coremltools' Starting TorchScript-Lite export with torch 2.0.1+cu118... TorchScript-Lite export success, saved as runs/train/yolov7x_custom4_60/weights/best.torchscript.ptl Starting ONNX export with onnx 1.14.0... /content/drive/MyDrive/yolov7/models/yolo.py:582: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if augment: /content/drive/MyDrive/yolov7/models/yolo.py:614: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if profile: /content/drive/MyDrive/yolov7/models/yolo.py:629: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if profile: ============= Diagnostic Run torch.onnx.export version 2.0.1+cu118 ============= verbose: False, log level: Level.ERROR ======================= 0 NONE 0 NOTE 0 WARNING 0 ERROR ======================== ONNX export success, saved as runs/train/yolov7x_custom4_60/weights/best.onnx Export complete (48.67s). Visualize with https://github.com/lutzroeder/netron.
!python train.py --workers 8 --batch-size 16 --data janken3_dataset.yaml --cfg cfg/training/yolov7x.yaml --weights 'yolov7x.pt' --name yolov7x_custom3_60 --hyp data/hyp.scratch.p5.yaml --epochs 60 --device 0
2023-08-09 07:17:03.748993: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: AVX2 AVX512F FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. 2023-08-09 07:17:05.923031: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT YOLOR 🚀 v0.1-122-g3b41c2c torch 2.0.1+cu118 CUDA:0 (Tesla T4, 15101.8125MB) Namespace(weights='yolov7x.pt', cfg='cfg/training/yolov7x.yaml', data='janken3_dataset.yaml', hyp='data/hyp.scratch.p5.yaml', epochs=60, batch_size=16, img_size=[640, 640], rect=False, resume=False, nosave=False, notest=False, noautoanchor=False, evolve=False, bucket='', cache_images=False, image_weights=False, device='0', multi_scale=False, single_cls=False, adam=False, sync_bn=False, local_rank=-1, workers=8, project='runs/train', entity=None, name='yolov7x_custom3_60', exist_ok=False, quad=False, linear_lr=False, label_smoothing=0.0, upload_dataset=False, bbox_interval=-1, save_period=-1, artifact_alias='latest', freeze=[0], v5_metric=False, world_size=1, global_rank=-1, save_dir='runs/train/yolov7x_custom3_60', total_batch_size=16) tensorboard: Start with 'tensorboard --logdir runs/train', view at http://localhost:6006/ hyperparameters: lr0=0.01, lrf=0.1, 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.3, cls_pw=1.0, obj=0.7, 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.2, scale=0.9, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.15, copy_paste=0.0, paste_in=0.15, loss_ota=1 wandb: Install Weights & Biases for YOLOR logging with 'pip install wandb' (recommended) Overriding model.yaml nc=80 with nc=3 from n params module arguments 0 -1 1 1160 models.common.Conv [3, 40, 3, 1] 1 -1 1 28960 models.common.Conv [40, 80, 3, 2] 2 -1 1 57760 models.common.Conv [80, 80, 3, 1] 3 -1 1 115520 models.common.Conv [80, 160, 3, 2] 4 -1 1 10368 models.common.Conv [160, 64, 1, 1] 5 -2 1 10368 models.common.Conv [160, 64, 1, 1] 6 -1 1 36992 models.common.Conv [64, 64, 3, 1] 7 -1 1 36992 models.common.Conv [64, 64, 3, 1] 8 -1 1 36992 models.common.Conv [64, 64, 3, 1] 9 -1 1 36992 models.common.Conv [64, 64, 3, 1] 10 -1 1 36992 models.common.Conv [64, 64, 3, 1] 11 -1 1 36992 models.common.Conv [64, 64, 3, 1] 12[-1, -3, -5, -7, -8] 1 0 models.common.Concat [1] 13 -1 1 103040 models.common.Conv [320, 320, 1, 1] 14 -1 1 0 models.common.MP [] 15 -1 1 51520 models.common.Conv [320, 160, 1, 1] 16 -3 1 51520 models.common.Conv [320, 160, 1, 1] 17 -1 1 230720 models.common.Conv [160, 160, 3, 2] 18 [-1, -3] 1 0 models.common.Concat [1] 19 -1 1 41216 models.common.Conv [320, 128, 1, 1] 20 -2 1 41216 models.common.Conv [320, 128, 1, 1] 21 -1 1 147712 models.common.Conv [128, 128, 3, 1] 22 -1 1 147712 models.common.Conv [128, 128, 3, 1] 23 -1 1 147712 models.common.Conv [128, 128, 3, 1] 24 -1 1 147712 models.common.Conv [128, 128, 3, 1] 25 -1 1 147712 models.common.Conv [128, 128, 3, 1] 26 -1 1 147712 models.common.Conv [128, 128, 3, 1] 27[-1, -3, -5, -7, -8] 1 0 models.common.Concat [1] 28 -1 1 410880 models.common.Conv [640, 640, 1, 1] 29 -1 1 0 models.common.MP [] 30 -1 1 205440 models.common.Conv [640, 320, 1, 1] 31 -3 1 205440 models.common.Conv [640, 320, 1, 1] 32 -1 1 922240 models.common.Conv [320, 320, 3, 2] 33 [-1, -3] 1 0 models.common.Concat [1] 34 -1 1 164352 models.common.Conv [640, 256, 1, 1] 35 -2 1 164352 models.common.Conv [640, 256, 1, 1] 36 -1 1 590336 models.common.Conv [256, 256, 3, 1] 37 -1 1 590336 models.common.Conv [256, 256, 3, 1] 38 -1 1 590336 models.common.Conv [256, 256, 3, 1] 39 -1 1 590336 models.common.Conv [256, 256, 3, 1] 40 -1 1 590336 models.common.Conv [256, 256, 3, 1] 41 -1 1 590336 models.common.Conv [256, 256, 3, 1] 42[-1, -3, -5, -7, -8] 1 0 models.common.Concat [1] 43 -1 1 1640960 models.common.Conv [1280, 1280, 1, 1] 44 -1 1 0 models.common.MP [] 45 -1 1 820480 models.common.Conv [1280, 640, 1, 1] 46 -3 1 820480 models.common.Conv [1280, 640, 1, 1] 47 -1 1 3687680 models.common.Conv [640, 640, 3, 2] 48 [-1, -3] 1 0 models.common.Concat [1] 49 -1 1 328192 models.common.Conv [1280, 256, 1, 1] 50 -2 1 328192 models.common.Conv [1280, 256, 1, 1] 51 -1 1 590336 models.common.Conv [256, 256, 3, 1] 52 -1 1 590336 models.common.Conv [256, 256, 3, 1] 53 -1 1 590336 models.common.Conv [256, 256, 3, 1] 54 -1 1 590336 models.common.Conv [256, 256, 3, 1] 55 -1 1 590336 models.common.Conv [256, 256, 3, 1] 56 -1 1 590336 models.common.Conv [256, 256, 3, 1] 57[-1, -3, -5, -7, -8] 1 0 models.common.Concat [1] 58 -1 1 1640960 models.common.Conv [1280, 1280, 1, 1] 59 -1 1 11887360 models.common.SPPCSPC [1280, 640, 1] 60 -1 1 205440 models.common.Conv [640, 320, 1, 1] 61 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] 62 43 1 410240 models.common.Conv [1280, 320, 1, 1] 63 [-1, -2] 1 0 models.common.Concat [1] 64 -1 1 164352 models.common.Conv [640, 256, 1, 1] 65 -2 1 164352 models.common.Conv [640, 256, 1, 1] 66 -1 1 590336 models.common.Conv [256, 256, 3, 1] 67 -1 1 590336 models.common.Conv [256, 256, 3, 1] 68 -1 1 590336 models.common.Conv [256, 256, 3, 1] 69 -1 1 590336 models.common.Conv [256, 256, 3, 1] 70 -1 1 590336 models.common.Conv [256, 256, 3, 1] 71 -1 1 590336 models.common.Conv [256, 256, 3, 1] 72[-1, -3, -5, -7, -8] 1 0 models.common.Concat [1] 73 -1 1 410240 models.common.Conv [1280, 320, 1, 1] 74 -1 1 51520 models.common.Conv [320, 160, 1, 1] 75 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] 76 28 1 102720 models.common.Conv [640, 160, 1, 1] 77 [-1, -2] 1 0 models.common.Concat [1] 78 -1 1 41216 models.common.Conv [320, 128, 1, 1] 79 -2 1 41216 models.common.Conv [320, 128, 1, 1] 80 -1 1 147712 models.common.Conv [128, 128, 3, 1] 81 -1 1 147712 models.common.Conv [128, 128, 3, 1] 82 -1 1 147712 models.common.Conv [128, 128, 3, 1] 83 -1 1 147712 models.common.Conv [128, 128, 3, 1] 84 -1 1 147712 models.common.Conv [128, 128, 3, 1] 85 -1 1 147712 models.common.Conv [128, 128, 3, 1] 86[-1, -3, -5, -7, -8] 1 0 models.common.Concat [1] 87 -1 1 102720 models.common.Conv [640, 160, 1, 1] 88 -1 1 0 models.common.MP [] 89 -1 1 25920 models.common.Conv [160, 160, 1, 1] 90 -3 1 25920 models.common.Conv [160, 160, 1, 1] 91 -1 1 230720 models.common.Conv [160, 160, 3, 2] 92 [-1, -3, 73] 1 0 models.common.Concat [1] 93 -1 1 164352 models.common.Conv [640, 256, 1, 1] 94 -2 1 164352 models.common.Conv [640, 256, 1, 1] 95 -1 1 590336 models.common.Conv [256, 256, 3, 1] 96 -1 1 590336 models.common.Conv [256, 256, 3, 1] 97 -1 1 590336 models.common.Conv [256, 256, 3, 1] 98 -1 1 590336 models.common.Conv [256, 256, 3, 1] 99 -1 1 590336 models.common.Conv [256, 256, 3, 1] 100 -1 1 590336 models.common.Conv [256, 256, 3, 1] 101[-1, -3, -5, -7, -8] 1 0 models.common.Concat [1] 102 -1 1 410240 models.common.Conv [1280, 320, 1, 1] 103 -1 1 0 models.common.MP [] 104 -1 1 103040 models.common.Conv [320, 320, 1, 1] 105 -3 1 103040 models.common.Conv [320, 320, 1, 1] 106 -1 1 922240 models.common.Conv [320, 320, 3, 2] 107 [-1, -3, 59] 1 0 models.common.Concat [1] 108 -1 1 656384 models.common.Conv [1280, 512, 1, 1] 109 -2 1 656384 models.common.Conv [1280, 512, 1, 1] 110 -1 1 2360320 models.common.Conv [512, 512, 3, 1] 111 -1 1 2360320 models.common.Conv [512, 512, 3, 1] 112 -1 1 2360320 models.common.Conv [512, 512, 3, 1] 113 -1 1 2360320 models.common.Conv [512, 512, 3, 1] 114 -1 1 2360320 models.common.Conv [512, 512, 3, 1] 115 -1 1 2360320 models.common.Conv [512, 512, 3, 1] 116[-1, -3, -5, -7, -8] 1 0 models.common.Concat [1] 117 -1 1 1639680 models.common.Conv [2560, 640, 1, 1] 118 87 1 461440 models.common.Conv [160, 320, 3, 1] 119 102 1 1844480 models.common.Conv [320, 640, 3, 1] 120 117 1 7375360 models.common.Conv [640, 1280, 3, 1] 121 [118, 119, 120] 1 56144 models.yolo.IDetect [3, [[12, 16, 19, 36, 40, 28], [36, 75, 76, 55, 72, 146], [142, 110, 192, 243, 459, 401]], [320, 640, 1280]] Model Summary: 467 layers, 70828568 parameters, 70828568 gradients Transferred 630/644 items from yolov7x.pt Scaled weight_decay = 0.0005 Optimizer groups: 108 .bias, 108 conv.weight, 111 other train: Scanning 'data/janken3_dataset/train/labels' images and labels... 480 found, 0 missing, 0 empty, 0 corrupted: 100% 480/480 [04:18<00:00, 1.85it/s] train: New cache created: data/janken3_dataset/train/labels.cache val: Scanning 'data/janken3_dataset/valid/labels' images and labels... 120 found, 0 missing, 0 empty, 0 corrupted: 100% 120/120 [01:07<00:00, 1.77it/s] val: New cache created: data/janken3_dataset/valid/labels.cache autoanchor: Analyzing anchors... anchors/target = 3.23, Best Possible Recall (BPR) = 1.0000 Image sizes 640 train, 640 test Using 2 dataloader workers Logging results to runs/train/yolov7x_custom3_60 Starting training for 60 epochs... Epoch gpu_mem box obj cls total labels img_size 0/59 14.3G 0.06481 0.01982 0.02153 0.1062 41 640: 100% 30/30 [01:02<00:00, 2.09s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 0% 0/4 [00:00<?, ?it/s]/usr/local/lib/python3.10/dist-packages/torch/functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3483.) return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:14<00:00, 3.73s/it] all 120 120 0.0999 0.207 0.0825 0.0174 Epoch gpu_mem box obj cls total labels img_size 1/59 14.3G 0.05633 0.01713 0.02164 0.0951 47 640: 100% 30/30 [00:43<00:00, 1.46s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.26it/s] all 120 120 0.191 0.364 0.22 0.0592 Epoch gpu_mem box obj cls total labels img_size 2/59 14.3G 0.05043 0.01585 0.01941 0.0857 51 640: 100% 30/30 [00:43<00:00, 1.44s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.45it/s] all 120 120 0.202 0.633 0.314 0.0893 Epoch gpu_mem box obj cls total labels img_size 3/59 14.3G 0.04696 0.01502 0.01868 0.08066 67 640: 100% 30/30 [00:43<00:00, 1.45s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.60it/s] all 120 120 0.319 0.701 0.37 0.141 Epoch gpu_mem box obj cls total labels img_size 4/59 14.3G 0.04292 0.01229 0.01758 0.07279 50 640: 100% 30/30 [00:42<00:00, 1.41s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.60it/s] all 120 120 0.431 0.674 0.53 0.293 Epoch gpu_mem box obj cls total labels img_size 5/59 14.3G 0.04311 0.01114 0.0168 0.07105 43 640: 100% 30/30 [00:41<00:00, 1.37s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.54it/s] all 120 120 0.628 0.555 0.577 0.341 Epoch gpu_mem box obj cls total labels img_size 6/59 14.3G 0.04423 0.01098 0.01612 0.07133 43 640: 100% 30/30 [00:42<00:00, 1.41s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.57it/s] all 120 120 0.613 0.785 0.717 0.453 Epoch gpu_mem box obj cls total labels img_size 7/59 14.3G 0.0432 0.009922 0.01542 0.06854 52 640: 100% 30/30 [00:41<00:00, 1.40s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.56it/s] all 120 120 0.691 0.692 0.717 0.445 Epoch gpu_mem box obj cls total labels img_size 8/59 14.3G 0.04108 0.01013 0.01499 0.06621 58 640: 100% 30/30 [00:41<00:00, 1.37s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.52it/s] all 120 120 0.537 0.883 0.746 0.474 Epoch gpu_mem box obj cls total labels img_size 9/59 14.3G 0.03604 0.01022 0.01225 0.05851 43 640: 100% 30/30 [00:41<00:00, 1.39s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.65it/s] all 120 120 0.684 0.879 0.824 0.536 Epoch gpu_mem box obj cls total labels img_size 10/59 14.3G 0.03672 0.009597 0.01315 0.05947 50 640: 100% 30/30 [00:41<00:00, 1.38s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.65it/s] all 120 120 0.626 0.908 0.803 0.489 Epoch gpu_mem box obj cls total labels img_size 11/59 14.3G 0.04129 0.009551 0.01267 0.06351 59 640: 100% 30/30 [00:41<00:00, 1.39s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.67it/s] all 120 120 0.373 0.317 0.27 0.119 Epoch gpu_mem box obj cls total labels img_size 12/59 14.3G 0.02942 0.008747 0.01061 0.04877 52 640: 100% 30/30 [00:40<00:00, 1.34s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.67it/s] all 120 120 0.579 0.757 0.774 0.475 Epoch gpu_mem box obj cls total labels img_size 13/59 14.3G 0.03783 0.008585 0.01085 0.05727 38 640: 100% 30/30 [00:39<00:00, 1.32s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.39it/s] all 120 120 0.427 0.492 0.413 0.207 Epoch gpu_mem box obj cls total labels img_size 14/59 14.3G 0.03228 0.008878 0.01038 0.05154 49 640: 100% 30/30 [00:40<00:00, 1.35s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.60it/s] all 120 120 0.363 0.742 0.578 0.38 Epoch gpu_mem box obj cls total labels img_size 15/59 14.3G 0.03806 0.008098 0.01121 0.05737 48 640: 100% 30/30 [00:40<00:00, 1.34s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.54it/s] all 120 120 0.8 0.925 0.946 0.617 Epoch gpu_mem box obj cls total labels img_size 16/59 14.3G 0.02959 0.007775 0.008601 0.04597 55 640: 100% 30/30 [00:41<00:00, 1.39s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.38it/s] all 120 120 0.846 0.974 0.942 0.611 Epoch gpu_mem box obj cls total labels img_size 17/59 14.3G 0.0361 0.007639 0.009075 0.05281 59 640: 100% 30/30 [00:39<00:00, 1.32s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.67it/s] all 120 120 0.855 0.931 0.923 0.644 Epoch gpu_mem box obj cls total labels img_size 18/59 14.3G 0.02951 0.00779 0.007817 0.04512 43 640: 100% 30/30 [00:41<00:00, 1.37s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.58it/s] all 120 120 0.96 0.974 0.987 0.705 Epoch gpu_mem box obj cls total labels img_size 19/59 14.3G 0.03645 0.007539 0.008417 0.0524 40 640: 100% 30/30 [00:43<00:00, 1.44s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.65it/s] all 120 120 0.976 0.958 0.983 0.657 Epoch gpu_mem box obj cls total labels img_size 20/59 14.3G 0.03475 0.007286 0.008353 0.05039 48 640: 100% 30/30 [00:39<00:00, 1.32s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.68it/s] all 120 120 0.966 0.988 0.99 0.609 Epoch gpu_mem box obj cls total labels img_size 21/59 14.3G 0.03028 0.007766 0.006915 0.04496 54 640: 100% 30/30 [00:40<00:00, 1.36s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.23it/s] all 120 120 0.945 0.97 0.992 0.697 Epoch gpu_mem box obj cls total labels img_size 22/59 14.3G 0.03151 0.007047 0.007776 0.04634 39 640: 100% 30/30 [00:40<00:00, 1.35s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.67it/s] all 120 120 0.972 0.991 0.994 0.715 Epoch gpu_mem box obj cls total labels img_size 23/59 14.3G 0.02865 0.007087 0.007575 0.04331 50 640: 100% 30/30 [00:40<00:00, 1.34s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.49it/s] all 120 120 0.988 0.992 0.994 0.761 Epoch gpu_mem box obj cls total labels img_size 24/59 14.3G 0.03597 0.007245 0.007859 0.05108 61 640: 100% 30/30 [00:41<00:00, 1.40s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.36it/s] all 120 120 0.998 0.994 0.995 0.776 Epoch gpu_mem box obj cls total labels img_size 25/59 14.3G 0.02482 0.007066 0.006001 0.03789 50 640: 100% 30/30 [00:43<00:00, 1.45s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.37it/s] all 120 120 0.992 0.979 0.993 0.73 Epoch gpu_mem box obj cls total labels img_size 26/59 14.3G 0.02712 0.006436 0.006694 0.04025 46 640: 100% 30/30 [00:42<00:00, 1.42s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.44it/s] all 120 120 0.997 0.983 0.995 0.813 Epoch gpu_mem box obj cls total labels img_size 27/59 14.3G 0.02434 0.006222 0.005279 0.03585 50 640: 100% 30/30 [00:41<00:00, 1.40s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.30it/s] all 120 120 0.99 0.983 0.992 0.71 Epoch gpu_mem box obj cls total labels img_size 28/59 14.3G 0.03037 0.006676 0.007277 0.04432 54 640: 100% 30/30 [00:39<00:00, 1.31s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.45it/s] all 120 120 1 0.971 0.994 0.783 Epoch gpu_mem box obj cls total labels img_size 29/59 14.3G 0.02856 0.00686 0.006412 0.04183 57 640: 100% 30/30 [00:41<00:00, 1.39s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.41it/s] all 120 120 0.976 0.968 0.99 0.756 Epoch gpu_mem box obj cls total labels img_size 30/59 14.3G 0.02806 0.006611 0.007299 0.04197 25 640: 100% 30/30 [00:39<00:00, 1.31s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.44it/s] all 120 120 0.991 0.983 0.992 0.793 Epoch gpu_mem box obj cls total labels img_size 31/59 14.3G 0.02129 0.006837 0.005455 0.03358 61 640: 100% 30/30 [00:42<00:00, 1.40s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.42it/s] all 120 120 0.981 0.975 0.992 0.823 Epoch gpu_mem box obj cls total labels img_size 32/59 14.3G 0.02571 0.006414 0.005985 0.03811 54 640: 100% 30/30 [00:41<00:00, 1.37s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.33it/s] all 120 120 0.955 0.95 0.984 0.789 Epoch gpu_mem box obj cls total labels img_size 33/59 14.3G 0.02688 0.006635 0.006443 0.03996 53 640: 100% 30/30 [00:41<00:00, 1.37s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.27it/s] all 120 120 0.965 0.975 0.987 0.792 Epoch gpu_mem box obj cls total labels img_size 34/59 14.3G 0.02485 0.006424 0.005758 0.03703 44 640: 100% 30/30 [00:39<00:00, 1.31s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.37it/s] all 120 120 0.631 0.725 0.744 0.454 Epoch gpu_mem box obj cls total labels img_size 35/59 14.3G 0.02762 0.006905 0.005953 0.04047 49 640: 100% 30/30 [00:40<00:00, 1.35s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.37it/s] all 120 120 0.808 0.747 0.807 0.42 Epoch gpu_mem box obj cls total labels img_size 36/59 14.3G 0.01968 0.006481 0.006056 0.03222 51 640: 100% 30/30 [00:39<00:00, 1.31s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.42it/s] all 120 120 0.382 0.217 0.148 0.0301 Epoch gpu_mem box obj cls total labels img_size 37/59 14.3G 0.02195 0.006775 0.005798 0.03452 34 640: 100% 30/30 [00:39<00:00, 1.31s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.58it/s] all 120 120 0.86 0.842 0.89 0.629 Epoch gpu_mem box obj cls total labels img_size 38/59 14.3G 0.02133 0.006274 0.005148 0.03275 43 640: 100% 30/30 [00:39<00:00, 1.32s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.64it/s] all 120 120 0.999 0.977 0.995 0.837 Epoch gpu_mem box obj cls total labels img_size 39/59 14.3G 0.02262 0.006346 0.005179 0.03415 61 640: 100% 30/30 [00:40<00:00, 1.35s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.48it/s] all 120 120 0.994 0.991 0.995 0.834 Epoch gpu_mem box obj cls total labels img_size 40/59 14.3G 0.02307 0.006292 0.004259 0.03362 43 640: 100% 30/30 [00:39<00:00, 1.32s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.45it/s] all 120 120 0.994 1 0.996 0.836 Epoch gpu_mem box obj cls total labels img_size 41/59 14.3G 0.02225 0.00641 0.005093 0.03375 48 640: 100% 30/30 [00:41<00:00, 1.38s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.65it/s] all 120 120 0.977 0.996 0.995 0.841 Epoch gpu_mem box obj cls total labels img_size 42/59 14.3G 0.02151 0.006024 0.004459 0.03199 46 640: 100% 30/30 [00:42<00:00, 1.42s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.31it/s] all 120 120 0.985 1 0.995 0.824 Epoch gpu_mem box obj cls total labels img_size 43/59 14.3G 0.01872 0.006157 0.004727 0.0296 54 640: 100% 30/30 [00:39<00:00, 1.33s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.49it/s] all 120 120 0.989 0.983 0.995 0.826 Epoch gpu_mem box obj cls total labels img_size 44/59 14.3G 0.01824 0.006611 0.00426 0.02911 52 640: 100% 30/30 [00:39<00:00, 1.33s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.43it/s] all 120 120 0.99 0.996 0.996 0.82 Epoch gpu_mem box obj cls total labels img_size 45/59 14.3G 0.0214 0.006344 0.005095 0.03284 54 640: 100% 30/30 [00:40<00:00, 1.34s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.45it/s] all 120 120 0.988 0.992 0.995 0.829 Epoch gpu_mem box obj cls total labels img_size 46/59 14.3G 0.01833 0.00611 0.004354 0.0288 44 640: 100% 30/30 [00:41<00:00, 1.37s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:03<00:00, 1.32it/s] all 120 120 0.985 0.987 0.995 0.84 Epoch gpu_mem box obj cls total labels img_size 47/59 14.3G 0.02191 0.00592 0.00454 0.03237 35 640: 100% 30/30 [00:40<00:00, 1.36s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.40it/s] all 120 120 0.986 0.987 0.995 0.839 Epoch gpu_mem box obj cls total labels img_size 48/59 14.3G 0.02266 0.006432 0.005727 0.03482 59 640: 100% 30/30 [00:41<00:00, 1.37s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.43it/s] all 120 120 0.984 0.983 0.995 0.848 Epoch gpu_mem box obj cls total labels img_size 49/59 14.3G 0.02121 0.00607 0.004583 0.03187 41 640: 100% 30/30 [00:42<00:00, 1.42s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.64it/s] all 120 120 0.992 0.984 0.995 0.846 Epoch gpu_mem box obj cls total labels img_size 50/59 14.3G 0.02293 0.005677 0.004965 0.03357 51 640: 100% 30/30 [00:41<00:00, 1.40s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.64it/s] all 120 120 0.99 0.984 0.995 0.839 Epoch gpu_mem box obj cls total labels img_size 51/59 14.3G 0.02374 0.00634 0.005306 0.03538 68 640: 100% 30/30 [00:40<00:00, 1.34s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.66it/s] all 120 120 0.99 0.988 0.995 0.831 Epoch gpu_mem box obj cls total labels img_size 52/59 14.3G 0.01929 0.005961 0.00391 0.02916 38 640: 100% 30/30 [00:43<00:00, 1.44s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.66it/s] all 120 120 0.983 0.992 0.994 0.839 Epoch gpu_mem box obj cls total labels img_size 53/59 14.3G 0.02643 0.005788 0.005144 0.03736 44 640: 100% 30/30 [00:41<00:00, 1.37s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.67it/s] all 120 120 0.963 0.956 0.994 0.836 Epoch gpu_mem box obj cls total labels img_size 54/59 14.3G 0.02467 0.00604 0.00572 0.03643 46 640: 100% 30/30 [00:42<00:00, 1.40s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.65it/s] all 120 120 0.995 0.999 0.996 0.841 Epoch gpu_mem box obj cls total labels img_size 55/59 14.3G 0.01827 0.00603 0.003857 0.02815 45 640: 100% 30/30 [00:42<00:00, 1.41s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.65it/s] all 120 120 0.997 1 0.996 0.846 Epoch gpu_mem box obj cls total labels img_size 56/59 14.3G 0.01512 0.00594 0.003486 0.02455 42 640: 100% 30/30 [00:43<00:00, 1.46s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.61it/s] all 120 120 1 0.992 0.996 0.85 Epoch gpu_mem box obj cls total labels img_size 57/59 14.3G 0.0172 0.006267 0.00407 0.02753 47 640: 100% 30/30 [00:45<00:00, 1.51s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.61it/s] all 120 120 0.999 0.983 0.996 0.841 Epoch gpu_mem box obj cls total labels img_size 58/59 14.3G 0.01775 0.005679 0.004252 0.02768 54 640: 100% 30/30 [00:42<00:00, 1.43s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:02<00:00, 1.60it/s] all 120 120 0.991 0.983 0.996 0.844 Epoch gpu_mem box obj cls total labels img_size 59/59 14.3G 0.02097 0.005839 0.004694 0.0315 49 640: 100% 30/30 [00:41<00:00, 1.38s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100% 4/4 [00:04<00:00, 1.03s/it] all 120 120 0.991 0.985 0.994 0.844 goo 120 40 1 1 0.995 0.865 choki 120 40 0.973 1 0.996 0.812 par 120 40 1 0.954 0.992 0.855 60 epochs completed in 0.835 hours. Optimizer stripped from runs/train/yolov7x_custom3_60/weights/last.pt, 142.1MB Optimizer stripped from runs/train/yolov7x_custom3_60/weights/best.pt, 142.1MB
!python export.py --weights runs/train/yolov7x_custom3_60/weights/best.pt
Import onnx_graphsurgeon failure: No module named 'onnx_graphsurgeon' Namespace(weights='runs/train/yolov7x_custom3_60/weights/best.pt', img_size=[640, 640], batch_size=1, dynamic=False, dynamic_batch=False, grid=False, end2end=False, max_wh=None, topk_all=100, iou_thres=0.45, conf_thres=0.25, device='cpu', simplify=False, include_nms=False, fp16=False, int8=False) YOLOR 🚀 v0.1-122-g3b41c2c torch 2.0.1+cu118 CPU Fusing layers... IDetect.fuse Model Summary: 362 layers, 70795920 parameters, 0 gradients Starting TorchScript export with torch 2.0.1+cu118... TorchScript export success, saved as runs/train/yolov7x_custom3_60/weights/best.torchscript.pt CoreML export failure: No module named 'coremltools' Starting TorchScript-Lite export with torch 2.0.1+cu118... TorchScript-Lite export success, saved as runs/train/yolov7x_custom3_60/weights/best.torchscript.ptl Starting ONNX export with onnx 1.14.0... /content/drive/MyDrive/yolov7/models/yolo.py:582: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if augment: /content/drive/MyDrive/yolov7/models/yolo.py:614: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if profile: /content/drive/MyDrive/yolov7/models/yolo.py:629: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if profile: ============= Diagnostic Run torch.onnx.export version 2.0.1+cu118 ============= verbose: False, log level: Level.ERROR ======================= 0 NONE 0 NOTE 0 WARNING 0 ERROR ======================== ONNX export success, saved as runs/train/yolov7x_custom3_60/weights/best.onnx Export complete (55.58s). Visualize with https://github.com/lutzroeder/netron.
janken4_dataset | janken3_dataset | janken2_dataset | janken_dataset | |
カメラ | 3 | 1 | 2 | 1 |
背景 | 3 | 1 | 3 | 1 |
手 | 3人 | 1人 | 1人 | 1人 |
テスト画像 | 撮影条件 |
janken3.jpg | 「janken4_dataset」撮影の環境の1つでの 1つのカメラと 1人の手 |
janken2.jpg | 「janken2_dataset」撮影の環境での 同一のカメラと 同一人の手 |
janken.jpg | 「janken_dataset」撮影の環境での 同一のカメラと 同一人の手 |
janken_test.mp4 | 「janken4_dataset」撮影の環境の1つでの 別のカメラ(一眼レフ)と 1人の手 |
janken_test2.mp4 | 「janken4_dataset」撮影の環境の1つでの 1つのカメラと 1人の手 |
(py38a) PS > cd /anaconda_win/work/yolov7・学習済みモデル④「yolov7x_custom4_60/weights/best.onnx」
入力ソース | コマンド |
カメラ画像 | python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom4_60/weights/best.onnx -l janken.names_jp -i cam -d GPU -o cam_custom4_60.mp4 |
janken3.jpg | python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom4_60/weights/best.onnx -l janken.names_jp -i ../../Images/janken3.jpg -d GPU -o janken3_custom4_60.jpg |
janken2.jpg | python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom4_60/weights/best.onnx -l janken.names_jp -i ../../Images/janken2.jpg -d GPU -o janken2_custom4_60.jpg |
janken.jpg | python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom4_60/weights/best.onnx -l janken.names_jp -i ../../Images/janken.jpg -d GPU -o janken_custom4_60.jpg |
janken_test.mp4 | python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom4_60/weights/best.onnx -l janken.names_jp -i ../../Videos/janken_test.mp4 -d GPU -o janken_test_custom4_60.mp4 |
janken_test2.mp4 | python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom4_60/weights/best.onnx -l janken.names_jp -i ../../Videos/janken_test2.mp4 -d GPU -o janken_test2_custom4_60.mp4 |
(py38a) PS > python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom4_60/weights/best.onnx -l janken.names_jp -i ../../Images/janken3.jpg -d GPU -o janken3_custom4_60.jpg Starting.. - Program title : Object detection YOLO V7 - OpenCV version : 4.5.5 - OpenVINO engine: 2022.1.0-7019-cdb9bec7210-releases/2022/1 - Input image : ../../Images/janken3.jpg - Model : ../yolov7-main/runs/train/yolov7x_custom4_60/weights/best.onnx - Device : GPU - Confidence thr : 0.25 - IOU threshold : 0.45 - Label : janken.names_jp - Log level : 3 - Title flag : y - Speed flag : y - Processed out : janken3_custom4_60.jpg - Preprocessing : False - Batch size : 1 - number of inf : 1 - With grid : False FPS average: 1.40 Finished. : (py38a) PS > python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom4_60/weights/best.onnx -l janken.names_jp -i ../../Videos/janken_test.mp4 -d GPU -o janken_test_custom4_60.mp4 Starting.. - Program title : Object detection YOLO V7 - OpenCV version : 4.5.5 - OpenVINO engine: 2022.1.0-7019-cdb9bec7210-releases/2022/1 - Input image : ../../Videos/janken_test.mp4 - Model : ../yolov7-main/runs/train/yolov7x_custom4_60/weights/best.onnx - Device : GPU - Confidence thr : 0.25 - IOU threshold : 0.45 - Label : janken.names_jp - Log level : 3 - Title flag : y - Speed flag : y - Processed out : janken_test_custom4_60.mp4 - Preprocessing : False - Batch size : 1 - number of inf : 1 - With grid : False FPS average: 1.50 Finished.
入力ソース | コマンド |
カメラ画像 | python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom3_60/weights/best.onnx -l janken.names_jp -i cam -d GPU -o cam_custom3_60.mp4 |
janken3.jpg | python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom3_60/weights/best.onnx -l janken.names_jp -i ../../Images/janken3.jpg -d GPU -o janken3_custom3_60.jpg |
janken2.jpg | python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom3_60/weights/best.onnx -l janken.names_jp -i ../../Images/janken2.jpg -d GPU -o janken2_custom3_60.jpg |
janken.jpg | python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom3_60/weights/best.onnx -l janken.names_jp -i ../../Images/janken.jpg -d GPU -o janken_custom3_60.jpg |
janken_test.mp4 | python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom3_60/weights/best.onnx -l janken.names_jp -i ../../Videos/janken_test.mp4 -d GPU -o janken_test_custom3_60.mp4 |
janken_test2.mp4 | python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom3_60/weights/best.onnx -l janken.names_jp -i ../../Videos/janken_test2.mp4 -d GPU -o janken_test2_custom3_60.mp4 |
入力ソース | コマンド |
カメラ画像 | python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom2_60/weights/best.onnx -l janken.names_jp -i cam -d GPU -o cam_custom2_60.mp4 |
janken3.jpg | python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom2_60/weights/best.onnx -l janken.names_jp -i ../../Images/janken3.jpg -d GPU -o janken3_custom2_60.jpg |
janken2.jpg | python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom2_60/weights/best.onnx -l janken.names_jp -i ../../Images/janken2.jpg -d GPU -o janken2_custom2_60.jpg |
janken.jpg | python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom2_60/weights/best.onnx -l janken.names_jp -i ../../Images/janken.jpg -d GPU -o janken_custom2_60.jpg |
janken_test.mp4 | python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom2_60/weights/best.onnx -l janken.names_jp -i ../../Videos/janken_test.mp4 -d GPU -o janken_test_custom2_60.mp4 |
janken_test2.mp4 | python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom2_60/weights/best.onnx -l janken.names_jp -i ../../Videos/janken_test2.mp4 -d GPU -o janken_test2_custom2_60.mp4 |
入力ソース | コマンド |
カメラ画像 | python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom_50/weights/best.onnx -l janken.names_jp -i cam -d GPU -o cam_custom_50.mp4 |
janken3.jpg | python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom_50/weights/best.onnx -l janken.names_jp -i ../../Images/janken3.jpg -d GPU -o janken3_custom_50.jpg |
janken2.jpg | python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom_50/weights/best.onnx -l janken.names_jp -i ../../Images/janken2.jpg -d GPU -o janken2_custom_50.jpg |
janken.jpg | python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom_50/weights/best.onnx -l janken.names_jp -i ../../Images/janken.jpg -d GPU -o janken_custom_50.jpg |
janken_test.mp4 | python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom_50/weights/best.onnx -l janken.names_jp -i ../../Videos/janken_test.mp4 -d GPU -o janken_test_custom_50.mp4 |
janken_test2.mp4 | python object_detect_yolo7.py -m ../yolov7-main/runs/train/yolov7x_custom_50/weights/best.onnx -l janken.names_jp -i ../../Videos/janken_test2.mp4 -d GPU -o janken_test2_custom_50.mp4 |
PukiWiki 1.5.2 © 2001-2019 PukiWiki Development Team. Powered by PHP 7.4.3-4ubuntu2.20. HTML convert time: 0.047 sec.