![](https://hackmd.io/_uploads/ByxQGczK2.png) ![](https://hackmd.io/_uploads/ByWGn3QKh.png) ``` git clone https://github.com/WongKinYiu/yolov7.git cd yolov7 pip install -r requirements.txt patch -p1 < yolov7_xpu.patch diff --git a/train.py b/train.py index 86c7e48..21815b7 100644 --- a/train.py +++ b/train.py @@ -286,7 +286,9 @@ def train(hyp, opt, device, tb_writer=None): model.nc = nc # attach number of classes to model model.hyp = hyp # attach hyperparameters to model model.gr = 1.0 # iou loss ratio (obj_loss = 1.0 or iou) - model.class_weights = labels_to_class_weights(dataset.labels, nc).to(device ) * nc # attach class weights + #model.class_weights = labels_to_class_weights(dataset.labels, nc).to(devic e) * nc # attach class weights + model.class_weights = labels_to_class_weights(dataset.labels, nc) * nc # a ttach class weights + model.class_weights = model.class_weights.to(device) model.names = names # Start training diff --git a/utils/autoanchor.py b/utils/autoanchor.py index f491032..5bb3f1a 100644 --- a/utils/autoanchor.py +++ b/utils/autoanchor.py @@ -49,7 +49,10 @@ def check_anchors(dataset, model, thr=4.0, imgsz=640): print(f'{prefix}ERROR: {e}') new_bpr = metric(anchors)[0] if new_bpr > bpr: # replace anchors - anchors = torch.tensor(anchors, device=m.anchors.device).type_as(m. anchors) + print("*** m.anchars.device : {}".format(m.anchors.device)) + #anchors = torch.tensor(anchors, device=m.anchors.device).type_as(m .anchors) + anchors = torch.tensor(anchors).type_as(m.anchors) + anchors = anchors.to(m.anchors.device) m.anchor_grid[:] = anchors.clone().view_as(m.anchor_grid) # for in ference check_anchor_order(m) m.anchors[:] = anchors.clone().view_as(m.anchors) / m.stride.to(m.a nchors.device).view(-1, 1, 1) # loss diff --git a/utils/torch_utils.py b/utils/torch_utils.py index 1e631b5..5a93bd7 100644 --- a/utils/torch_utils.py +++ b/utils/torch_utils.py @@ -17,6 +17,8 @@ import torch.nn as nn import torch.nn.functional as F import torchvision +import intel_extension_for_pytorch as ipex + try: import thop # for FLOPS computation except ImportError: @@ -64,13 +66,17 @@ def select_device(device='', batch_size=None): # device = 'cpu' or '0' or '0,1,2,3' s = f'YOLOR 🚀 {git_describe() or date_modified()} torch {torch.__version__ } ' # string cpu = device.lower() == 'cpu' + xpu = device.lower() == 'xpu' if cpu: os.environ['CUDA_VISIBLE_DEVICES'] = '-1' # force torch.cuda.is_availa ble() = False + elif xpu: # non-cpu device requested + os.environ['CUDA_VISIBLE_DEVICES'] = '-1' # force torch.cuda.is_availa ble() = False + assert torch.xpu.is_available(), f'XPU unavailable, invalid device {dev ice} requested' # check availability elif device: # non-cpu device requested os.environ['CUDA_VISIBLE_DEVICES'] = device # set environment variable assert torch.cuda.is_available(), f'CUDA unavailable, invalid device {d evice} requested' # check availability - cuda = not cpu and torch.cuda.is_available() + cuda = not cpu and not xpu and torch.cuda.is_available() if cuda: n = torch.cuda.device_count() if n > 1 and batch_size: # check that batch_size is compatible with de vice_count @@ -79,11 +85,19 @@ def select_device(device='', batch_size=None): for i, d in enumerate(device.split(',') if device else range(n)): p = torch.cuda.get_device_properties(i) s += f"{'' if i == 0 else space}CUDA:{d} ({p.name}, {p.total_memory / 1024 ** 2}MB)\n" # bytes to MB + s += f"{'' if i == 0 else space}CUDA:{d} ({p.name}, {p.total_memory / 1024 ** 2}MB)\n" # bytes to MB + elif xpu: + s += 'XPU\n' else: s += 'CPU\n' logger.info(s.encode().decode('ascii', 'ignore') if platform.system() == 'W indows' else s) # emoji-safe - return torch.device('cuda:0' if cuda else 'cpu') + if cuda: + return torch.device('cuda:0') + elif xpu: + return torch.device('xpu') + else: + return torch.device('cpu') def time_synchronized(): @@ -371,4 +385,4 @@ class TracedModel(nn.Module): def forward(self, x, augment=False, profile=False): out = self.model(x) out = self.detect_layer(out) - return out \ No newline at end of file + return out ``` ``` wget https://learnopencv.s3.us-west-2.amazonaws.com/pothole_dataset.zip unzip -q pothole_dataset.zip wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-tiny.pt vim data/pothole.yaml ## content of data/pothole.yaml ## train: ../pothole_dataset/images/train val: ../pothole_dataset/images/valid test: ../pothole_dataset/images/test # Classes nc: 1 # number of classes names: ['pothole'] # class names ## content of data/pothole.yaml ## wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-tiny.pt cp cfg/training/yolov7-tiny.yaml cfg/training/yolov7_pothole-tiny.yaml ### modify "nc: 80" to "nc: 1" in cfg/training/yolov7_pothole-tiny.yaml ``` Reference : https://learnopencv.com/fine-tuning-yolov7-on-custom-dataset/ ``` eapet@eapet-NUC12SNKi72:~/yolov7_ipex/yolov7$ git diff diff --git a/train.py b/train.py index 86c7e48..21815b7 100644 --- a/train.py +++ b/train.py @@ -286,7 +286,9 @@ def train(hyp, opt, device, tb_writer=None): model.nc = nc # attach number of classes to model model.hyp = hyp # attach hyperparameters to model model.gr = 1.0 # iou loss ratio (obj_loss = 1.0 or iou) - model.class_weights = labels_to_class_weights(dataset.labels, nc).to(device) * nc # attach class weights + #model.class_weights = labels_to_class_weights(dataset.labels, nc).to(device) * nc # attach class weights + model.class_weights = labels_to_class_weights(dataset.labels, nc) * nc # attach class weights + model.class_weights = model.class_weights.to(device) model.names = names # Start training diff --git a/utils/autoanchor.py b/utils/autoanchor.py index f491032..5bb3f1a 100644 --- a/utils/autoanchor.py +++ b/utils/autoanchor.py @@ -49,7 +49,10 @@ def check_anchors(dataset, model, thr=4.0, imgsz=640): print(f'{prefix}ERROR: {e}') new_bpr = metric(anchors)[0] if new_bpr > bpr: # replace anchors - anchors = torch.tensor(anchors, device=m.anchors.device).type_as(m.anchors) + print("*** m.anchars.device : {}".format(m.anchors.device)) + #anchors = torch.tensor(anchors, device=m.anchors.device).type_as(m.anchors) + anchors = torch.tensor(anchors).type_as(m.anchors) + anchors = anchors.to(m.anchors.device) m.anchor_grid[:] = anchors.clone().view_as(m.anchor_grid) # for inference check_anchor_order(m) m.anchors[:] = anchors.clone().view_as(m.anchors) / m.stride.to(m.anchors.device).view(-1, 1, 1) # loss diff --git a/utils/torch_utils.py b/utils/torch_utils.py index 1e631b5..5a93bd7 100644 --- a/utils/torch_utils.py +++ b/utils/torch_utils.py @@ -17,6 +17,8 @@ import torch.nn as nn import torch.nn.functional as F import torchvision +import intel_extension_for_pytorch as ipex + try: import thop # for FLOPS computation except ImportError: @@ -64,13 +66,17 @@ def select_device(device='', batch_size=None): # device = 'cpu' or '0' or '0,1,2,3' s = f'YOLOR 🚀 {git_describe() or date_modified()} torch {torch.__version__} ' # string cpu = device.lower() == 'cpu' + xpu = device.lower() == 'xpu' if cpu: os.environ['CUDA_VISIBLE_DEVICES'] = '-1' # force torch.cuda.is_available() = False + elif xpu: # non-cpu device requested + os.environ['CUDA_VISIBLE_DEVICES'] = '-1' # force torch.cuda.is_available() = False + assert torch.xpu.is_available(), f'XPU unavailable, invalid device {device} requested' # check availability elif device: # non-cpu device requested os.environ['CUDA_VISIBLE_DEVICES'] = device # set environment variable assert torch.cuda.is_available(), f'CUDA unavailable, invalid device {device} requested' # check availability - cuda = not cpu and torch.cuda.is_available() + cuda = not cpu and not xpu and torch.cuda.is_available() if cuda: n = torch.cuda.device_count() if n > 1 and batch_size: # check that batch_size is compatible with device_count @@ -79,11 +85,19 @@ def select_device(device='', batch_size=None): for i, d in enumerate(device.split(',') if device else range(n)): p = torch.cuda.get_device_properties(i) s += f"{'' if i == 0 else space}CUDA:{d} ({p.name}, {p.total_memory / 1024 ** 2}MB)\n" # bytes to MB + s += f"{'' if i == 0 else space}CUDA:{d} ({p.name}, {p.total_memory / 1024 ** 2}MB)\n" # bytes to MB + elif xpu: + s += 'XPU\n' else: s += 'CPU\n' logger.info(s.encode().decode('ascii', 'ignore') if platform.system() == 'Windows' else s) # emoji-safe - return torch.device('cuda:0' if cuda else 'cpu') + if cuda: + return torch.device('cuda:0') + elif xpu: + return torch.device('xpu') + else: + return torch.device('cpu') def time_synchronized(): @@ -371,4 +385,4 @@ class TracedModel(nn.Module): def forward(self, x, augment=False, profile=False): out = self.model(x) out = self.detect_layer(out) - return out \ No newline at end of file + return out (END) ``` ``` (ipex) eapet@eapet-NUC12SNKi72:~/yolov7_ipex/yolov7$ python train.py --epochs 10 --workers 4 --device xpu --batch-size 32 --data data/pothole.yaml --img 640 640 --cfg cfg/training/yolov7_pothole-tiny.yaml --weights 'yolov7-tiny.pt' --name yolov7_tiny_pothole_fixed_res --hyp data/hyp.scratch.tiny.yaml /home/eapet/ipex/lib/python3.10/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: warn(f"Failed to load image Python extension: {e}") 2023-07-05 14:13:17,297 - utils.torch_utils - INFO - YOLOR 🚀 v0.1-126-g84932d7 torch 1.13.0a0+git6c9b55e XPU 2023-07-05 14:13:17,299 - __main__ - INFO - Namespace(weights='yolov7-tiny.pt', cfg='cfg/training/yolov7_pothole-tiny.yaml', data='data/pothole.yaml', hyp='data/hyp.scratch.tiny.yaml', epochs=10, batch_size=32, img_size=[640, 640], rect=False, resume=False, nosave=False, notest=False, noautoanchor=False, evolve=False, bucket='', cache_images=False, image_weights=False, device='xpu', multi_scale=False, single_cls=False, adam=False, sync_bn=False, local_rank=-1, workers=4, project='runs/train', entity=None, name='yolov7_tiny_pothole_fixed_res', 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/yolov7_tiny_pothole_fixed_res14', total_batch_size=32) 2023-07-05 14:13:17,299 - __main__ - INFO - tensorboard: Start with 'tensorboard --logdir runs/train', view at http://localhost:6006/ 2023-07-05 14:13:17,356 - __main__ - INFO - hyperparameters: lr0=0.01, lrf=0.01, 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.05, copy_paste=0.0, paste_in=0.05, loss_ota=1 wandb: Install Weights & Biases for YOLOR logging with 'pip install wandb' (recommended) 2023-07-05 14:13:17,482 - models.yolo - INFO - from n params module arguments 2023-07-05 14:13:17,483 - models.yolo - INFO - 0 -1 1 928 models.common.Conv [3, 32, 3, 2, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,483 - models.yolo - INFO - 1 -1 1 18560 models.common.Conv [32, 64, 3, 2, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,483 - models.yolo - INFO - 2 -1 1 2112 models.common.Conv [64, 32, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,483 - models.yolo - INFO - 3 -2 1 2112 models.common.Conv [64, 32, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,484 - models.yolo - INFO - 4 -1 1 9280 models.common.Conv [32, 32, 3, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,484 - models.yolo - INFO - 5 -1 1 9280 models.common.Conv [32, 32, 3, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,484 - models.yolo - INFO - 6 [-1, -2, -3, -4] 1 0 models.common.Concat [1] 2023-07-05 14:13:17,484 - models.yolo - INFO - 7 -1 1 8320 models.common.Conv [128, 64, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,484 - models.yolo - INFO - 8 -1 1 0 models.common.MP [] 2023-07-05 14:13:17,484 - models.yolo - INFO - 9 -1 1 4224 models.common.Conv [64, 64, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,484 - models.yolo - INFO - 10 -2 1 4224 models.common.Conv [64, 64, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,485 - models.yolo - INFO - 11 -1 1 36992 models.common.Conv [64, 64, 3, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,485 - models.yolo - INFO - 12 -1 1 36992 models.common.Conv [64, 64, 3, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,485 - models.yolo - INFO - 13 [-1, -2, -3, -4] 1 0 models.common.Concat [1] 2023-07-05 14:13:17,485 - models.yolo - INFO - 14 -1 1 33024 models.common.Conv [256, 128, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,485 - models.yolo - INFO - 15 -1 1 0 models.common.MP [] 2023-07-05 14:13:17,485 - models.yolo - INFO - 16 -1 1 16640 models.common.Conv [128, 128, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,485 - models.yolo - INFO - 17 -2 1 16640 models.common.Conv [128, 128, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,486 - models.yolo - INFO - 18 -1 1 147712 models.common.Conv [128, 128, 3, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,486 - models.yolo - INFO - 19 -1 1 147712 models.common.Conv [128, 128, 3, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,487 - models.yolo - INFO - 20 [-1, -2, -3, -4] 1 0 models.common.Concat [1] 2023-07-05 14:13:17,487 - models.yolo - INFO - 21 -1 1 131584 models.common.Conv [512, 256, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,487 - models.yolo - INFO - 22 -1 1 0 models.common.MP [] 2023-07-05 14:13:17,487 - models.yolo - INFO - 23 -1 1 66048 models.common.Conv [256, 256, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,488 - models.yolo - INFO - 24 -2 1 66048 models.common.Conv [256, 256, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,490 - models.yolo - INFO - 25 -1 1 590336 models.common.Conv [256, 256, 3, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,492 - models.yolo - INFO - 26 -1 1 590336 models.common.Conv [256, 256, 3, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,492 - models.yolo - INFO - 27 [-1, -2, -3, -4] 1 0 models.common.Concat [1] 2023-07-05 14:13:17,494 - models.yolo - INFO - 28 -1 1 525312 models.common.Conv [1024, 512, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,494 - models.yolo - INFO - 29 -1 1 131584 models.common.Conv [512, 256, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,495 - models.yolo - INFO - 30 -2 1 131584 models.common.Conv [512, 256, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,495 - models.yolo - INFO - 31 -1 1 0 models.common.SP [5] 2023-07-05 14:13:17,495 - models.yolo - INFO - 32 -2 1 0 models.common.SP [9] 2023-07-05 14:13:17,495 - models.yolo - INFO - 33 -3 1 0 models.common.SP [13] 2023-07-05 14:13:17,495 - models.yolo - INFO - 34 [-1, -2, -3, -4] 1 0 models.common.Concat [1] 2023-07-05 14:13:17,496 - models.yolo - INFO - 35 -1 1 262656 models.common.Conv [1024, 256, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,496 - models.yolo - INFO - 36 [-1, -7] 1 0 models.common.Concat [1] 2023-07-05 14:13:17,497 - models.yolo - INFO - 37 -1 1 131584 models.common.Conv [512, 256, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,497 - models.yolo - INFO - 38 -1 1 33024 models.common.Conv [256, 128, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,497 - models.yolo - INFO - 39 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] 2023-07-05 14:13:17,497 - models.yolo - INFO - 40 21 1 33024 models.common.Conv [256, 128, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,497 - models.yolo - INFO - 41 [-1, -2] 1 0 models.common.Concat [1] 2023-07-05 14:13:17,498 - models.yolo - INFO - 42 -1 1 16512 models.common.Conv [256, 64, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,498 - models.yolo - INFO - 43 -2 1 16512 models.common.Conv [256, 64, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,498 - models.yolo - INFO - 44 -1 1 36992 models.common.Conv [64, 64, 3, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,498 - models.yolo - INFO - 45 -1 1 36992 models.common.Conv [64, 64, 3, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,498 - models.yolo - INFO - 46 [-1, -2, -3, -4] 1 0 models.common.Concat [1] 2023-07-05 14:13:17,499 - models.yolo - INFO - 47 -1 1 33024 models.common.Conv [256, 128, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,499 - models.yolo - INFO - 48 -1 1 8320 models.common.Conv [128, 64, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,499 - models.yolo - INFO - 49 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] 2023-07-05 14:13:17,499 - models.yolo - INFO - 50 14 1 8320 models.common.Conv [128, 64, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,499 - models.yolo - INFO - 51 [-1, -2] 1 0 models.common.Concat [1] 2023-07-05 14:13:17,499 - models.yolo - INFO - 52 -1 1 4160 models.common.Conv [128, 32, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,499 - models.yolo - INFO - 53 -2 1 4160 models.common.Conv [128, 32, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,499 - models.yolo - INFO - 54 -1 1 9280 models.common.Conv [32, 32, 3, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,500 - models.yolo - INFO - 55 -1 1 9280 models.common.Conv [32, 32, 3, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,500 - models.yolo - INFO - 56 [-1, -2, -3, -4] 1 0 models.common.Concat [1] 2023-07-05 14:13:17,500 - models.yolo - INFO - 57 -1 1 8320 models.common.Conv [128, 64, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,500 - models.yolo - INFO - 58 -1 1 73984 models.common.Conv [64, 128, 3, 2, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,500 - models.yolo - INFO - 59 [-1, 47] 1 0 models.common.Concat [1] 2023-07-05 14:13:17,501 - models.yolo - INFO - 60 -1 1 16512 models.common.Conv [256, 64, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,501 - models.yolo - INFO - 61 -2 1 16512 models.common.Conv [256, 64, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,501 - models.yolo - INFO - 62 -1 1 36992 models.common.Conv [64, 64, 3, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,501 - models.yolo - INFO - 63 -1 1 36992 models.common.Conv [64, 64, 3, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,502 - models.yolo - INFO - 64 [-1, -2, -3, -4] 1 0 models.common.Concat [1] 2023-07-05 14:13:17,502 - models.yolo - INFO - 65 -1 1 33024 models.common.Conv [256, 128, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,503 - models.yolo - INFO - 66 -1 1 295424 models.common.Conv [128, 256, 3, 2, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,503 - models.yolo - INFO - 67 [-1, 37] 1 0 models.common.Concat [1] 2023-07-05 14:13:17,503 - models.yolo - INFO - 68 -1 1 65792 models.common.Conv [512, 128, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,504 - models.yolo - INFO - 69 -2 1 65792 models.common.Conv [512, 128, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,505 - models.yolo - INFO - 70 -1 1 147712 models.common.Conv [128, 128, 3, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,505 - models.yolo - INFO - 71 -1 1 147712 models.common.Conv [128, 128, 3, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,505 - models.yolo - INFO - 72 [-1, -2, -3, -4] 1 0 models.common.Concat [1] 2023-07-05 14:13:17,506 - models.yolo - INFO - 73 -1 1 131584 models.common.Conv [512, 256, 1, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,506 - models.yolo - INFO - 74 57 1 73984 models.common.Conv [64, 128, 3, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,508 - models.yolo - INFO - 75 65 1 295424 models.common.Conv [128, 256, 3, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,512 - models.yolo - INFO - 76 73 1 1180672 models.common.Conv [256, 512, 3, 1, None, 1, LeakyReLU(negative_slope=0.1)] 2023-07-05 14:13:17,513 - models.yolo - INFO - 77 [74, 75, 76] 1 17132 models.yolo.IDetect [1, [[10, 13, 16, 30, 33, 23], [30, 61, 62, 45, 59, 119], [116, 90, 156, 198, 373, 326]], [128, 256, 512]] /home/eapet/ipex/lib/python3.10/site-packages/torch/functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at /build/pytorch/aten/src/ATen/native/TensorShape.cpp:3190.) return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined] 2023-07-05 14:13:17,560 - utils.torch_utils - INFO - Model Summary: 263 layers, 6014988 parameters, 6014988 gradients, 13.2 GFLOPS 2023-07-05 14:13:17,560 - models.yolo - INFO - 2023-07-05 14:13:17,640 - __main__ - INFO - Transferred 330/344 items from yolov7-tiny.pt 2023-07-05 14:13:17,641 - __main__ - INFO - Scaled weight_decay = 0.0005 2023-07-05 14:13:17,643 - __main__ - INFO - Optimizer groups: 58 .bias, 58 conv.weight, 61 other train: Scanning '../pothole_dataset/labels/train.cache' images and labels... 1265 found, 0 missing, 0 empty, 1 corrupted: 100%|████████████████████████████████████████████████| 1265/1265 [00:00<?, ?it/s] val: Scanning '../pothole_dataset/labels/valid.cache' images and labels... 401 found, 0 missing, 0 empty, 0 corrupted: 100%|█████████████████████████████████████████████████████| 401/401 [00:00<?, ?it/s] autoanchor: Analyzing anchors... anchors/target = 2.49, Best Possible Recall (BPR) = 0.8156. Attempting to improve anchors, please wait... autoanchor: WARNING: Extremely small objects found. 538 of 3497 labels are < 3 pixels in size. autoanchor: Running kmeans for 9 anchors on 3497 points... autoanchor: thr=0.25: 1.0000 best possible recall, 3.19 anchors past thr autoanchor: n=9, img_size=640, metric_all=0.234/0.705-mean/best, past_thr=0.507-mean: 14,4, 32,10, 66,24, 101,54, 198,66, 172,120, 368,121, 246,205, 505,258 autoanchor: Evolving anchors with Genetic Algorithm: fitness = 0.7526: 100%|██████████████████████████████████████████████████████████████████████████████████████████| 1000/1000 [00:01<00:00, 639.33it/s] autoanchor: thr=0.25: 1.0000 best possible recall, 3.81 anchors past thr autoanchor: n=9, img_size=640, metric_all=0.271/0.753-mean/best, past_thr=0.518-mean: 9,2, 17,4, 27,8, 44,14, 85,34, 188,64, 140,93, 245,161, 523,256 *** m.anchars.device : xpu:0 autoanchor: New anchors saved to model. Update model *.yaml to use these anchors in the future. /home/eapet/ipex/lib/python3.10/site-packages/torch/cuda/amp/grad_scaler.py:118: UserWarning: torch.cuda.amp.GradScaler is enabled, but CUDA is not available. Disabling. warnings.warn("torch.cuda.amp.GradScaler is enabled, but CUDA is not available. Disabling.") 2023-07-05 14:13:20,080 - __main__ - INFO - Image sizes 640 train, 640 test Using 4 dataloader workers Logging results to runs/train/yolov7_tiny_pothole_fixed_res14 Starting training for 10 epochs... 2023-07-05 14:13:20,147 - __main__ - INFO - Epoch gpu_mem box obj cls total labels img_size 0%| | 0/40 [00:00<?, ?it/s]/home/eapet/ipex/lib/python3.10/site-packages/torch/amp/autocast_mode.py:202: UserWarning: User provided device_type of 'cuda', but CUDA is not available. Disabling warnings.warn('User provided device_type of \'cuda\', but CUDA is not available. Disabling') 0/9 0G 0.09813 0.01452 0 0.1126 66 640: 100%|████████████████████████████████████████████████████████████████████████████████████| 40/40 [01:44<00:00, 2.61s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100%|██████████████████████████████████████████████████████████████████████████| 7/7 [00:18<00:00, 2.68s/it] all 401 1034 0.00256 0.0387 0.000212 3.4e-05 2023-07-05 14:15:24,082 - __main__ - INFO - Epoch gpu_mem box obj cls total labels img_size 1/9 0G 0.08652 0.008683 0 0.09521 61 640: 100%|████████████████████████████████████████████████████████████████████████████████████| 40/40 [01:25<00:00, 2.15s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100%|██████████████████████████████████████████████████████████████████████████| 7/7 [00:07<00:00, 1.03s/it] all 401 1034 0.00436 0.0184 0.000309 5.07e-05 2023-07-05 14:16:57,784 - __main__ - INFO - Epoch gpu_mem box obj cls total labels img_size 2/9 0G 0.07896 0.008948 0 0.08791 90 640: 100%|████████████████████████████████████████████████████████████████████████████████████| 40/40 [01:30<00:00, 2.26s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100%|██████████████████████████████████████████████████████████████████████████| 7/7 [00:06<00:00, 1.04it/s] all 401 1034 0.0441 0.0638 0.00528 0.00102 2023-07-05 14:18:35,491 - __main__ - INFO - Epoch gpu_mem box obj cls total labels img_size 3/9 0G 0.07289 0.01031 0 0.08321 73 640: 100%|████████████████████████████████████████████████████████████████████████████████████| 40/40 [01:27<00:00, 2.19s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100%|██████████████████████████████████████████████████████████████████████████| 7/7 [00:07<00:00, 1.03s/it] all 401 1034 0.0803 0.0822 0.0122 0.00325 2023-07-05 14:20:11,003 - __main__ - INFO - Epoch gpu_mem box obj cls total labels img_size 4/9 0G 0.06713 0.01085 0 0.07798 82 640: 100%|████████████████████████████████████████████████████████████████████████████████████| 40/40 [01:27<00:00, 2.18s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100%|██████████████████████████████████████████████████████████████████████████| 7/7 [00:06<00:00, 1.02it/s] all 401 1034 0.208 0.126 0.0555 0.0176 2023-07-05 14:21:45,765 - __main__ - INFO - Epoch gpu_mem box obj cls total labels img_size 5/9 0G 0.06281 0.01059 0 0.0734 36 640: 100%|████████████████████████████████████████████████████████████████████████████████████| 40/40 [01:25<00:00, 2.13s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100%|██████████████████████████████████████████████████████████████████████████| 7/7 [00:07<00:00, 1.00s/it] all 401 1034 0.275 0.175 0.125 0.0456 2023-07-05 14:23:18,839 - __main__ - INFO - Epoch gpu_mem box obj cls total labels img_size 6/9 0G 0.05917 0.01034 0 0.06951 49 640: 100%|████████████████████████████████████████████████████████████████████████████████████| 40/40 [01:25<00:00, 2.14s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100%|██████████████████████████████████████████████████████████████████████████| 7/7 [00:07<00:00, 1.01s/it] all 401 1034 0.242 0.258 0.172 0.0645 2023-07-05 14:24:52,286 - __main__ - INFO - Epoch gpu_mem box obj cls total labels img_size 7/9 0G 0.05743 0.01041 0 0.06784 54 640: 100%|████████████████████████████████████████████████████████████████████████████████████| 40/40 [01:25<00:00, 2.14s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100%|██████████████████████████████████████████████████████████████████████████| 7/7 [00:07<00:00, 1.00s/it] all 401 1034 0.355 0.289 0.233 0.0899 2023-07-05 14:26:25,966 - __main__ - INFO - Epoch gpu_mem box obj cls total labels img_size 8/9 0G 0.05476 0.01043 0 0.06519 52 640: 100%|████████████████████████████████████████████████████████████████████████████████████| 40/40 [01:25<00:00, 2.13s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100%|██████████████████████████████████████████████████████████████████████████| 7/7 [00:07<00:00, 1.01s/it] all 401 1034 0.366 0.336 0.26 0.105 2023-07-05 14:27:59,072 - __main__ - INFO - Epoch gpu_mem box obj cls total labels img_size 9/9 0G 0.05418 0.01044 0 0.06462 54 640: 100%|████████████████████████████████████████████████████████████████████████████████████| 40/40 [01:25<00:00, 2.14s/it] Class Images Labels P R mAP@.5 mAP@.5:.95: 100%|██████████████████████████████████████████████████████████████████████████| 7/7 [00:08<00:00, 1.26s/it] all 401 1034 0.434 0.325 0.288 0.117 2023-07-05 14:29:35,547 - __main__ - INFO - 10 epochs completed in 0.271 hours. Optimizer stripped from runs/train/yolov7_tiny_pothole_fixed_res14/weights/last.pt, 12.3MB Optimizer stripped from runs/train/yolov7_tiny_pothole_fixed_res14/weights/best.pt, 12.3MB ``` ## Train YOLOv7 log ``` (ipex) eapet@eapet-NUC12SNKi72:~/yolov7_ipex/yolov7$ python train.py --epochs 10 --workers 4 --device xpu --batch-size 8 --data data/pothole.yaml --img 640 640 --cfg cfg/training/yolov7_pothole.yaml --weights 'yolov7_training.pt' --name yolov7_pothole_fixed_res --hyp data/hyp.scratch.custom.yaml /home/eapet/ipex/lib/python3.10/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: warn(f"Failed to load image Python extension: {e}") 2023-07-06 21:04:48,894 - utils.torch_utils - INFO - YOLOR 🚀 v0.1-126-g84932d7 torch 1.13.0a0+git6c9b55e XPU 2023-07-06 21:04:48,895 - __main__ - INFO - Namespace(weights='yolov7_training.pt', cfg='cfg/training/yolov7_pothole.yaml', data='data/pothole.yaml', hyp='data/hyp.scratch.custom.yaml', epochs=10, batch_size=8, img_size=[640, 640], rect=False, resume=False, nosave=False, notest=False, noautoanchor=False, evolve=False, bucket='', cache_images=False, image_weights=False, device='xpu', multi_scale=False, single_cls=False, adam=False, sync_bn=False, local_rank=-1, workers=4, project='runs/train', entity=None, name='yolov7_pothole_fixed_res', 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/yolov7_pothole_fixed_res6', total_batch_size=8) 2023-07-06 21:04:48,896 - __main__ - INFO - tensorboard: Start with 'tensorboard --logdir runs/train', view at http://localhost:6006/ 2023-07-06 21:04:48,896 - __main__ - INFO - 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.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.0, copy_paste=0.0, paste_in=0.0, loss_ota=1 wandb: Install Weights & Biases for YOLOR logging with 'pip install wandb' (recommended) 2023-07-06 21:04:49,108 - models.yolo - INFO - from n params module arguments 2023-07-06 21:04:49,109 - models.yolo - INFO - 0 -1 1 928 models.common.Conv [3, 32, 3, 1] 2023-07-06 21:04:49,109 - models.yolo - INFO - 1 -1 1 18560 models.common.Conv [32, 64, 3, 2] 2023-07-06 21:04:49,110 - models.yolo - INFO - 2 -1 1 36992 models.common.Conv [64, 64, 3, 1] 2023-07-06 21:04:49,110 - models.yolo - INFO - 3 -1 1 73984 models.common.Conv [64, 128, 3, 2] 2023-07-06 21:04:49,110 - models.yolo - INFO - 4 -1 1 8320 models.common.Conv [128, 64, 1, 1] 2023-07-06 21:04:49,110 - models.yolo - INFO - 5 -2 1 8320 models.common.Conv [128, 64, 1, 1] 2023-07-06 21:04:49,110 - models.yolo - INFO - 6 -1 1 36992 models.common.Conv [64, 64, 3, 1] 2023-07-06 21:04:49,111 - models.yolo - INFO - 7 -1 1 36992 models.common.Conv [64, 64, 3, 1] 2023-07-06 21:04:49,111 - models.yolo - INFO - 8 -1 1 36992 models.common.Conv [64, 64, 3, 1] 2023-07-06 21:04:49,111 - models.yolo - INFO - 9 -1 1 36992 models.common.Conv [64, 64, 3, 1] 2023-07-06 21:04:49,111 - models.yolo - INFO - 10 [-1, -3, -5, -6] 1 0 models.common.Concat [1] 2023-07-06 21:04:49,111 - models.yolo - INFO - 11 -1 1 66048 models.common.Conv [256, 256, 1, 1] 2023-07-06 21:04:49,111 - models.yolo - INFO - 12 -1 1 0 models.common.MP [] 2023-07-06 21:04:49,112 - models.yolo - INFO - 13 -1 1 33024 models.common.Conv [256, 128, 1, 1] 2023-07-06 21:04:49,112 - models.yolo - INFO - 14 -3 1 33024 models.common.Conv [256, 128, 1, 1] 2023-07-06 21:04:49,112 - models.yolo - INFO - 15 -1 1 147712 models.common.Conv [128, 128, 3, 2] 2023-07-06 21:04:49,112 - models.yolo - INFO - 16 [-1, -3] 1 0 models.common.Concat [1] 2023-07-06 21:04:49,113 - models.yolo - INFO - 17 -1 1 33024 models.common.Conv [256, 128, 1, 1] 2023-07-06 21:04:49,113 - models.yolo - INFO - 18 -2 1 33024 models.common.Conv [256, 128, 1, 1] 2023-07-06 21:04:49,113 - models.yolo - INFO - 19 -1 1 147712 models.common.Conv [128, 128, 3, 1] 2023-07-06 21:04:49,114 - models.yolo - INFO - 20 -1 1 147712 models.common.Conv [128, 128, 3, 1] 2023-07-06 21:04:49,114 - models.yolo - INFO - 21 -1 1 147712 models.common.Conv [128, 128, 3, 1] 2023-07-06 21:04:49,115 - models.yolo - INFO - 22 -1 1 147712 models.common.Conv [128, 128, 3, 1] 2023-07-06 21:04:49,115 - models.yolo - INFO - 23 [-1, -3, -5, -6] 1 0 models.common.Concat [1] 2023-07-06 21:04:49,116 - models.yolo - INFO - 24 -1 1 263168 models.common.Conv [512, 512, 1, 1] 2023-07-06 21:04:49,116 - models.yolo - INFO - 25 -1 1 0 models.common.MP [] 2023-07-06 21:04:49,116 - models.yolo - INFO - 26 -1 1 131584 models.common.Conv [512, 256, 1, 1] 2023-07-06 21:04:49,117 - models.yolo - INFO - 27 -3 1 131584 models.common.Conv [512, 256, 1, 1] 2023-07-06 21:04:49,119 - models.yolo - INFO - 28 -1 1 590336 models.common.Conv [256, 256, 3, 2] 2023-07-06 21:04:49,119 - models.yolo - INFO - 29 [-1, -3] 1 0 models.common.Concat [1] 2023-07-06 21:04:49,119 - models.yolo - INFO - 30 -1 1 131584 models.common.Conv [512, 256, 1, 1] 2023-07-06 21:04:49,120 - models.yolo - INFO - 31 -2 1 131584 models.common.Conv [512, 256, 1, 1] 2023-07-06 21:04:49,122 - models.yolo - INFO - 32 -1 1 590336 models.common.Conv [256, 256, 3, 1] 2023-07-06 21:04:49,124 - models.yolo - INFO - 33 -1 1 590336 models.common.Conv [256, 256, 3, 1] 2023-07-06 21:04:49,126 - models.yolo - INFO - 34 -1 1 590336 models.common.Conv [256, 256, 3, 1] 2023-07-06 21:04:49,128 - models.yolo - INFO - 35 -1 1 590336 models.common.Conv [256, 256, 3, 1] 2023-07-06 21:04:49,128 - models.yolo - INFO - 36 [-1, -3, -5, -6] 1 0 models.common.Concat [1] 2023-07-06 21:04:49,131 - models.yolo - INFO - 37 -1 1 1050624 models.common.Conv [1024, 1024, 1, 1] 2023-07-06 21:04:49,132 - models.yolo - INFO - 38 -1 1 0 models.common.MP [] 2023-07-06 21:04:49,133 - models.yolo - INFO - 39 -1 1 525312 models.common.Conv [1024, 512, 1, 1] 2023-07-06 21:04:49,135 - models.yolo - INFO - 40 -3 1 525312 models.common.Conv [1024, 512, 1, 1] 2023-07-06 21:04:49,143 - models.yolo - INFO - 41 -1 1 2360320 models.common.Conv [512, 512, 3, 2] 2023-07-06 21:04:49,143 - models.yolo - INFO - 42 [-1, -3] 1 0 models.common.Concat [1] 2023-07-06 21:04:49,144 - models.yolo - INFO - 43 -1 1 262656 models.common.Conv [1024, 256, 1, 1] 2023-07-06 21:04:49,145 - models.yolo - INFO - 44 -2 1 262656 models.common.Conv [1024, 256, 1, 1] 2023-07-06 21:04:49,147 - models.yolo - INFO - 45 -1 1 590336 models.common.Conv [256, 256, 3, 1] 2023-07-06 21:04:49,149 - models.yolo - INFO - 46 -1 1 590336 models.common.Conv [256, 256, 3, 1] 2023-07-06 21:04:49,151 - models.yolo - INFO - 47 -1 1 590336 models.common.Conv [256, 256, 3, 1] 2023-07-06 21:04:49,153 - models.yolo - INFO - 48 -1 1 590336 models.common.Conv [256, 256, 3, 1] 2023-07-06 21:04:49,153 - models.yolo - INFO - 49 [-1, -3, -5, -6] 1 0 models.common.Concat [1] 2023-07-06 21:04:49,157 - models.yolo - INFO - 50 -1 1 1050624 models.common.Conv [1024, 1024, 1, 1] 2023-07-06 21:04:49,182 - models.yolo - INFO - 51 -1 1 7609344 models.common.SPPCSPC [1024, 512, 1] 2023-07-06 21:04:49,182 - models.yolo - INFO - 52 -1 1 131584 models.common.Conv [512, 256, 1, 1] 2023-07-06 21:04:49,182 - models.yolo - INFO - 53 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] 2023-07-06 21:04:49,183 - models.yolo - INFO - 54 37 1 262656 models.common.Conv [1024, 256, 1, 1] 2023-07-06 21:04:49,183 - models.yolo - INFO - 55 [-1, -2] 1 0 models.common.Concat [1] 2023-07-06 21:04:49,184 - models.yolo - INFO - 56 -1 1 131584 models.common.Conv [512, 256, 1, 1] 2023-07-06 21:04:49,185 - models.yolo - INFO - 57 -2 1 131584 models.common.Conv [512, 256, 1, 1] 2023-07-06 21:04:49,186 - models.yolo - INFO - 58 -1 1 295168 models.common.Conv [256, 128, 3, 1] 2023-07-06 21:04:49,186 - models.yolo - INFO - 59 -1 1 147712 models.common.Conv [128, 128, 3, 1] 2023-07-06 21:04:49,187 - models.yolo - INFO - 60 -1 1 147712 models.common.Conv [128, 128, 3, 1] 2023-07-06 21:04:49,188 - models.yolo - INFO - 61 -1 1 147712 models.common.Conv [128, 128, 3, 1] 2023-07-06 21:04:49,188 - models.yolo - INFO - 62[-1, -2, -3, -4, -5, -6] 1 0 models.common.Concat [1] 2023-07-06 21:04:49,189 - models.yolo - INFO - 63 -1 1 262656 models.common.Conv [1024, 256, 1, 1] 2023-07-06 21:04:49,189 - models.yolo - INFO - 64 -1 1 33024 models.common.Conv [256, 128, 1, 1] 2023-07-06 21:04:49,189 - models.yolo - INFO - 65 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] 2023-07-06 21:04:49,189 - models.yolo - INFO - 66 24 1 65792 models.common.Conv [512, 128, 1, 1] 2023-07-06 21:04:49,189 - models.yolo - INFO - 67 [-1, -2] 1 0 models.common.Concat [1] 2023-07-06 21:04:49,189 - models.yolo - INFO - 68 -1 1 33024 models.common.Conv [256, 128, 1, 1] 2023-07-06 21:04:49,190 - models.yolo - INFO - 69 -2 1 33024 models.common.Conv [256, 128, 1, 1] 2023-07-06 21:04:49,190 - models.yolo - INFO - 70 -1 1 73856 models.common.Conv [128, 64, 3, 1] 2023-07-06 21:04:49,190 - models.yolo - INFO - 71 -1 1 36992 models.common.Conv [64, 64, 3, 1] 2023-07-06 21:04:49,191 - models.yolo - INFO - 72 -1 1 36992 models.common.Conv [64, 64, 3, 1] 2023-07-06 21:04:49,191 - models.yolo - INFO - 73 -1 1 36992 models.common.Conv [64, 64, 3, 1] 2023-07-06 21:04:49,191 - models.yolo - INFO - 74[-1, -2, -3, -4, -5, -6] 1 0 models.common.Concat [1] 2023-07-06 21:04:49,191 - models.yolo - INFO - 75 -1 1 65792 models.common.Conv [512, 128, 1, 1] 2023-07-06 21:04:49,191 - models.yolo - INFO - 76 -1 1 0 models.common.MP [] 2023-07-06 21:04:49,191 - models.yolo - INFO - 77 -1 1 16640 models.common.Conv [128, 128, 1, 1] 2023-07-06 21:04:49,192 - models.yolo - INFO - 78 -3 1 16640 models.common.Conv [128, 128, 1, 1] 2023-07-06 21:04:49,192 - models.yolo - INFO - 79 -1 1 147712 models.common.Conv [128, 128, 3, 2] 2023-07-06 21:04:49,192 - models.yolo - INFO - 80 [-1, -3, 63] 1 0 models.common.Concat [1] 2023-07-06 21:04:49,193 - models.yolo - INFO - 81 -1 1 131584 models.common.Conv [512, 256, 1, 1] 2023-07-06 21:04:49,193 - models.yolo - INFO - 82 -2 1 131584 models.common.Conv [512, 256, 1, 1] 2023-07-06 21:04:49,195 - models.yolo - INFO - 83 -1 1 295168 models.common.Conv [256, 128, 3, 1] 2023-07-06 21:04:49,195 - models.yolo - INFO - 84 -1 1 147712 models.common.Conv [128, 128, 3, 1] 2023-07-06 21:04:49,196 - models.yolo - INFO - 85 -1 1 147712 models.common.Conv [128, 128, 3, 1] 2023-07-06 21:04:49,196 - models.yolo - INFO - 86 -1 1 147712 models.common.Conv [128, 128, 3, 1] 2023-07-06 21:04:49,196 - models.yolo - INFO - 87[-1, -2, -3, -4, -5, -6] 1 0 models.common.Concat [1] 2023-07-06 21:04:49,197 - models.yolo - INFO - 88 -1 1 262656 models.common.Conv [1024, 256, 1, 1] 2023-07-06 21:04:49,198 - models.yolo - INFO - 89 -1 1 0 models.common.MP [] 2023-07-06 21:04:49,198 - models.yolo - INFO - 90 -1 1 66048 models.common.Conv [256, 256, 1, 1] 2023-07-06 21:04:49,198 - models.yolo - INFO - 91 -3 1 66048 models.common.Conv [256, 256, 1, 1] 2023-07-06 21:04:49,200 - models.yolo - INFO - 92 -1 1 590336 models.common.Conv [256, 256, 3, 2] 2023-07-06 21:04:49,200 - models.yolo - INFO - 93 [-1, -3, 51] 1 0 models.common.Concat [1] 2023-07-06 21:04:49,202 - models.yolo - INFO - 94 -1 1 525312 models.common.Conv [1024, 512, 1, 1] 2023-07-06 21:04:49,204 - models.yolo - INFO - 95 -2 1 525312 models.common.Conv [1024, 512, 1, 1] 2023-07-06 21:04:49,208 - models.yolo - INFO - 96 -1 1 1180160 models.common.Conv [512, 256, 3, 1] 2023-07-06 21:04:49,210 - models.yolo - INFO - 97 -1 1 590336 models.common.Conv [256, 256, 3, 1] 2023-07-06 21:04:49,212 - models.yolo - INFO - 98 -1 1 590336 models.common.Conv [256, 256, 3, 1] 2023-07-06 21:04:49,214 - models.yolo - INFO - 99 -1 1 590336 models.common.Conv [256, 256, 3, 1] 2023-07-06 21:04:49,214 - models.yolo - INFO - 100[-1, -2, -3, -4, -5, -6] 1 0 models.common.Concat [1] 2023-07-06 21:04:49,218 - models.yolo - INFO - 101 -1 1 1049600 models.common.Conv [2048, 512, 1, 1] 2023-07-06 21:04:49,219 - models.yolo - INFO - 102 75 1 328704 models.common.RepConv [128, 256, 3, 1] 2023-07-06 21:04:49,223 - models.yolo - INFO - 103 88 1 1312768 models.common.RepConv [256, 512, 3, 1] 2023-07-06 21:04:49,240 - models.yolo - INFO - 104 101 1 5246976 models.common.RepConv [512, 1024, 3, 1] 2023-07-06 21:04:49,241 - models.yolo - INFO - 105 [102, 103, 104] 1 34156 models.yolo.IDetect [1, [[12, 16, 19, 36, 40, 28], [36, 75, 76, 55, 72, 146], [142, 110, 192, 243, 459, 401]], [256, 512, 1024]] /home/eapet/ipex/lib/python3.10/site-packages/torch/functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at /build/pytorch/aten/src/ATen/native/TensorShape.cpp:3190.) return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined] 2023-07-06 21:04:49,424 - utils.torch_utils - INFO - Model Summary: 415 layers, 37196556 parameters, 37196556 gradients, 105.1 GFLOPS 2023-07-06 21:04:49,424 - models.yolo - INFO - 2023-07-06 21:04:49,536 - __main__ - INFO - Transferred 555/566 items from yolov7_training.pt 2023-07-06 21:04:49,537 - __main__ - INFO - Scaled weight_decay = 0.0005 2023-07-06 21:04:49,539 - __main__ - INFO - Optimizer groups: 95 .bias, 95 conv.weight, 98 other train: Scanning '../pothole_dataset/labels/train.cache' images and labels... 1265 found, 0 missing, 0 empty, 1 corrupted: 100%|████████████████████████████████████████████████| 1265/1265 [00:00<?, ?it/s] val: Scanning '../pothole_dataset/labels/valid.cache' images and labels... 401 found, 0 missing, 0 empty, 0 corrupted: 100%|█████████████████████████████████████████████████████| 401/401 [00:00<?, ?it/s] autoanchor: Analyzing anchors... anchors/target = 2.30, Best Possible Recall (BPR) = 0.7486. Attempting to improve anchors, please wait... autoanchor: WARNING: Extremely small objects found. 538 of 3497 labels are < 3 pixels in size. autoanchor: Running kmeans for 9 anchors on 3497 points... autoanchor: thr=0.25: 1.0000 best possible recall, 3.19 anchors past thr autoanchor: n=9, img_size=640, metric_all=0.234/0.705-mean/best, past_thr=0.507-mean: 14,4, 32,10, 66,24, 101,54, 198,66, 172,120, 368,121, 246,205, 505,258 autoanchor: Evolving anchors with Genetic Algorithm: fitness = 0.7526: 100%|█████████████████████████████████████████████████████████████████████████████████████████| 1000/1000 [00:00<00:00, 3759.13it/s] autoanchor: thr=0.25: 1.0000 best possible recall, 3.81 anchors past thr autoanchor: n=9, img_size=640, metric_all=0.271/0.753-mean/best, past_thr=0.518-mean: 9,2, 17,4, 27,8, 44,14, 85,34, 188,64, 140,93, 245,161, 523,256 *** m.anchars.device : xpu:0 autoanchor: New anchors saved to model. Update model *.yaml to use these anchors in the future. /home/eapet/ipex/lib/python3.10/site-packages/torch/cuda/amp/grad_scaler.py:118: UserWarning: torch.cuda.amp.GradScaler is enabled, but CUDA is not available. Disabling. warnings.warn("torch.cuda.amp.GradScaler is enabled, but CUDA is not available. Disabling.") 2023-07-06 21:04:50,457 - __main__ - INFO - Image sizes 640 train, 640 test Using 4 dataloader workers Logging results to runs/train/yolov7_pothole_fixed_res6 Starting training for 10 epochs... ```