{ "cells": [ { "cell_type": "code", "source": [ "!pip -q install roboflow" ], "metadata": { "id": "9mHxo7St9-ne", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "6b852d74-c3be-44b4-d6db-3b0d3b03fdac" }, "execution_count": 1, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "\u001b[?25l \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m0.0/95.8 kB\u001b[0m \u001b[31m?\u001b[0m eta \u001b[36m-:--:--\u001b[0m\r\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m95.8/95.8 kB\u001b[0m \u001b[31m4.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m66.8/66.8 kB\u001b[0m \u001b[31m4.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m49.9/49.9 MB\u001b[0m \u001b[31m15.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.5/1.5 MB\u001b[0m \u001b[31m34.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.5/5.5 MB\u001b[0m \u001b[31m65.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25h" ] } ] }, { "cell_type": "code", "source": [ "from roboflow import Roboflow\n", "rf = Roboflow(api_key=\"39VEjqC54eLDMKL0gi9Y\")\n", "project = rf.workspace(\"steph-r3xmc\").project(\"combined-dataset-3n32l\")\n", "version = project.version(5)\n", "dataset = version.download(\"yolov11\")" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "OJivkSiV_Vbp", "outputId": "2619e402-5c53-4b13-97e4-223a1066a603" }, "execution_count": 2, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "loading Roboflow workspace...\n", "loading Roboflow project...\n" ] }, { "output_type": "stream", "name": "stderr", "text": [ "Downloading Dataset Version Zip in Combined-dataset-5 to yolov11:: 100%|██████████| 255472/255472 [00:07<00:00, 33544.31it/s]" ] }, { "output_type": "stream", "name": "stdout", "text": [ "\n" ] }, { "output_type": "stream", "name": "stderr", "text": [ "\n", "Extracting Dataset Version Zip to Combined-dataset-5 in yolov11:: 100%|██████████| 10946/10946 [00:02<00:00, 4517.29it/s]\n" ] } ] }, { "cell_type": "code", "source": [ "print(dataset.location)" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "5Jt61ANrquno", "outputId": "40b7d34d-571b-48cf-84aa-0e89aea74e53" }, "execution_count": 3, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "/content/Combined-dataset-5\n" ] } ] }, { "cell_type": "code", "source": [ "!pip -q install ultralytics" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "8k5HlCmtEKFi", "outputId": "8491b897-e7c3-4d0a-80f4-543c7c3791d6" }, "execution_count": 4, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "\u001b[?25l \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m0.0/1.2 MB\u001b[0m \u001b[31m?\u001b[0m eta \u001b[36m-:--:--\u001b[0m\r\u001b[2K \u001b[91m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[91m╸\u001b[0m \u001b[32m1.2/1.2 MB\u001b[0m \u001b[31m37.4 MB/s\u001b[0m eta \u001b[36m0:00:01\u001b[0m\r\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.2/1.2 MB\u001b[0m \u001b[31m20.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25h" ] } ] }, { "cell_type": "code", "source": [ "import ultralytics\n", "print(ultralytics.__version__)" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "5qYmO6NzrL-h", "outputId": "79a07110-3873-43be-fbd5-6d8a57103bc7" }, "execution_count": 5, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Creating new Ultralytics Settings v0.0.6 file ✅ \n", "View Ultralytics Settings with 'yolo settings' or at '/root/.config/Ultralytics/settings.json'\n", "Update Settings with 'yolo settings key=value', i.e. 'yolo settings runs_dir=path/to/dir'. For help see https://docs.ultralytics.com/quickstart/#ultralytics-settings.\n", "8.4.21\n" ] } ] }, { "cell_type": "code", "source": [ "from ultralytics import YOLO\n", "\n", "model = YOLO(\"yolo11l.pt\")" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "WYkRrVg7rSfJ", "outputId": "ad7e3343-424a-49d2-a208-7e97ba520cb2" }, "execution_count": 6, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "\u001b[KDownloading https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo11l.pt to 'yolo11l.pt': 100% ━━━━━━━━━━━━ 49.0MB 138.0MB/s 0.4s\n" ] } ] }, { "cell_type": "code", "source": [ "model.train(\n", " data=f\"{dataset.location}/data.yaml\",\n", " epochs=40,\n", " imgsz=800,\n", " batch=8,\n", " mosaic=1.0,\n", " iou=0.6,\n", " device=0,\n", " workers=8\n", ")" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 1000 }, "id": "rAz4zOVJFcDv", "outputId": "0e6a253b-b921-423e-e470-58c54405c409" }, "execution_count": 7, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Ultralytics 8.4.21 🚀 Python-3.12.12 torch-2.10.0+cu128 CUDA:0 (Tesla T4, 14913MiB)\n", "\u001b[34m\u001b[1mengine/trainer: \u001b[0magnostic_nms=False, amp=True, angle=1.0, augment=False, auto_augment=randaugment, batch=8, bgr=0.0, box=7.5, cache=False, cfg=None, classes=None, close_mosaic=10, cls=0.5, compile=False, conf=None, copy_paste=0.0, copy_paste_mode=flip, cos_lr=False, cutmix=0.0, data=/content/Combined-dataset-5/data.yaml, degrees=0.0, deterministic=True, device=0, dfl=1.5, dnn=False, dropout=0.0, dynamic=False, embed=None, end2end=None, epochs=40, erasing=0.4, exist_ok=False, fliplr=0.5, flipud=0.0, format=torchscript, fraction=1.0, freeze=None, half=False, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, imgsz=800, int8=False, iou=0.6, keras=False, kobj=1.0, line_width=None, lr0=0.01, lrf=0.01, mask_ratio=4, max_det=300, mixup=0.0, mode=train, model=yolo11l.pt, momentum=0.937, mosaic=1.0, multi_scale=0.0, name=train, nbs=64, nms=False, opset=None, optimize=False, optimizer=auto, overlap_mask=True, patience=100, perspective=0.0, plots=True, pose=12.0, pretrained=True, profile=False, project=None, rect=False, resume=False, retina_masks=False, rle=1.0, save=True, save_conf=False, save_crop=False, save_dir=/content/runs/detect/train, save_frames=False, save_json=False, save_period=-1, save_txt=False, scale=0.5, seed=0, shear=0.0, show=False, show_boxes=True, show_conf=True, show_labels=True, simplify=True, single_cls=False, source=None, split=val, stream_buffer=False, task=detect, time=None, tracker=botsort.yaml, translate=0.1, val=True, verbose=True, vid_stride=1, visualize=False, warmup_bias_lr=0.1, warmup_epochs=3.0, warmup_momentum=0.8, weight_decay=0.0005, workers=8, workspace=None\n", "\u001b[KDownloading https://ultralytics.com/assets/Arial.ttf to '/root/.config/Ultralytics/Arial.ttf': 100% ━━━━━━━━━━━━ 755.1KB 13.3MB/s 0.1s\n", "Overriding model.yaml nc=80 with nc=67\n", "\n", " from n params module arguments \n", " 0 -1 1 1856 ultralytics.nn.modules.conv.Conv [3, 64, 3, 2] \n", " 1 -1 1 73984 ultralytics.nn.modules.conv.Conv [64, 128, 3, 2] \n", " 2 -1 2 173824 ultralytics.nn.modules.block.C3k2 [128, 256, 2, True, 0.25] \n", " 3 -1 1 590336 ultralytics.nn.modules.conv.Conv [256, 256, 3, 2] \n", " 4 -1 2 691712 ultralytics.nn.modules.block.C3k2 [256, 512, 2, True, 0.25] \n", " 5 -1 1 2360320 ultralytics.nn.modules.conv.Conv [512, 512, 3, 2] \n", " 6 -1 2 2234368 ultralytics.nn.modules.block.C3k2 [512, 512, 2, True] \n", " 7 -1 1 2360320 ultralytics.nn.modules.conv.Conv [512, 512, 3, 2] \n", " 8 -1 2 2234368 ultralytics.nn.modules.block.C3k2 [512, 512, 2, True] \n", " 9 -1 1 656896 ultralytics.nn.modules.block.SPPF [512, 512, 5] \n", " 10 -1 2 1455616 ultralytics.nn.modules.block.C2PSA [512, 512, 2] \n", " 11 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n", " 12 [-1, 6] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", " 13 -1 2 2496512 ultralytics.nn.modules.block.C3k2 [1024, 512, 2, True] \n", " 14 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] \n", " 15 [-1, 4] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", " 16 -1 2 756736 ultralytics.nn.modules.block.C3k2 [1024, 256, 2, True] \n", " 17 -1 1 590336 ultralytics.nn.modules.conv.Conv [256, 256, 3, 2] \n", " 18 [-1, 13] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", " 19 -1 2 2365440 ultralytics.nn.modules.block.C3k2 [768, 512, 2, True] \n", " 20 -1 1 2360320 ultralytics.nn.modules.conv.Conv [512, 512, 3, 2] \n", " 21 [-1, 10] 1 0 ultralytics.nn.modules.conv.Concat [1] \n", " 22 -1 2 2496512 ultralytics.nn.modules.block.C3k2 [1024, 512, 2, True] \n", " 23 [16, 19, 22] 1 1462681 ultralytics.nn.modules.head.Detect [67, 16, None, [256, 512, 512]]\n", "YOLO11l summary: 358 layers, 25,362,137 parameters, 25,362,121 gradients, 87.6 GFLOPs\n", "\n", "Transferred 1009/1015 items from pretrained weights\n", "Freezing layer 'model.23.dfl.conv.weight'\n", "\u001b[34m\u001b[1mAMP: \u001b[0mrunning Automatic Mixed Precision (AMP) checks...\n", "\u001b[KDownloading https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26n.pt to 'yolo26n.pt': 100% ━━━━━━━━━━━━ 5.3MB 53.7MB/s 0.1s\n", "\u001b[34m\u001b[1mAMP: \u001b[0mchecks passed ✅\n", "\u001b[34m\u001b[1mtrain: \u001b[0mFast image access ✅ (ping: 0.0±0.0 ms, read: 1238.8±602.2 MB/s, size: 43.7 KB)\n", "\u001b[K\u001b[34m\u001b[1mtrain: \u001b[0mScanning /content/Combined-dataset-5/train/labels... 4504 images, 0 backgrounds, 0 corrupt: 100% ━━━━━━━━━━━━ 4504/4504 2.1Kit/s 2.1s\n", "\u001b[34m\u001b[1mtrain: \u001b[0mNew cache created: /content/Combined-dataset-5/train/labels.cache\n", "WARNING ⚠️ Box and segment counts should be equal, but got len(segments) = 18, len(boxes) = 31824. To resolve this only boxes will be used and all segments will be removed. To avoid this please supply either a detect or segment dataset, not a detect-segment mixed dataset.\n", "\u001b[34m\u001b[1malbumentations: \u001b[0mBlur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01, method='weighted_average', num_output_channels=3), CLAHE(p=0.01, clip_limit=(1.0, 4.0), tile_grid_size=(8, 8))\n", "\u001b[34m\u001b[1mval: \u001b[0mFast image access ✅ (ping: 0.0±0.0 ms, read: 396.2±355.8 MB/s, size: 45.7 KB)\n", "\u001b[K\u001b[34m\u001b[1mval: \u001b[0mScanning /content/Combined-dataset-5/valid/labels... 641 images, 0 backgrounds, 0 corrupt: 100% ━━━━━━━━━━━━ 641/641 1.0Kit/s 0.6s\n", "\u001b[34m\u001b[1mval: \u001b[0mNew cache created: /content/Combined-dataset-5/valid/labels.cache\n", "\u001b[34m\u001b[1moptimizer:\u001b[0m 'optimizer=auto' found, ignoring 'lr0=0.01' and 'momentum=0.937' and determining best 'optimizer', 'lr0' and 'momentum' automatically... \n", "\u001b[34m\u001b[1moptimizer:\u001b[0m AdamW(lr=0.000141, momentum=0.9) with parameter groups 167 weight(decay=0.0), 174 weight(decay=0.0005), 173 bias(decay=0.0)\n", "Plotting labels to /content/runs/detect/train/labels.jpg... \n", "Image sizes 800 train, 800 val\n", "Using 2 dataloader workers\n", "Logging results to \u001b[1m/content/runs/detect/train\u001b[0m\n", "Starting training for 40 epochs...\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 1/40 7.98G 1.037 1.634 1.132 77 800: 100% ━━━━━━━━━━━━ 563/563 1.3it/s 6:57\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 1.5it/s 26.6s\n", " all 641 4631 0.798 0.491 0.532 0.376\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 2/40 8.23G 0.9482 0.7598 1.094 87 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:38\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.6s\n", " all 641 4631 0.643 0.606 0.623 0.44\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 3/40 8.12G 0.9297 0.6757 1.089 82 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:36\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.3s\n", " all 641 4631 0.678 0.637 0.686 0.487\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 4/40 8.13G 0.9163 0.6309 1.087 67 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:35\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.8s\n", " all 641 4631 0.656 0.705 0.729 0.521\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 5/40 8.21G 0.8912 0.5852 1.075 84 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:36\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.6s\n", " all 641 4631 0.748 0.708 0.762 0.553\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 6/40 8.22G 0.882 0.5609 1.071 88 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:36\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.4s\n", " all 641 4631 0.701 0.746 0.77 0.565\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 7/40 8.22G 0.8753 0.5473 1.072 83 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:37\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.3s\n", " all 641 4631 0.769 0.731 0.782 0.579\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 8/40 8.21G 0.8636 0.5211 1.066 61 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:37\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.5s\n", " all 641 4631 0.759 0.755 0.796 0.593\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 9/40 8.22G 0.8556 0.5082 1.06 111 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:37\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.6s\n", " all 641 4631 0.744 0.762 0.796 0.593\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 10/40 8.2G 0.8342 0.4957 1.052 82 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:36\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.7s\n", " all 641 4631 0.776 0.756 0.801 0.598\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 11/40 8.23G 0.8215 0.4778 1.046 138 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:36\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.4s\n", " all 641 4631 0.804 0.785 0.84 0.639\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 12/40 8.13G 0.8135 0.4693 1.041 44 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:35\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.2s\n", " all 641 4631 0.845 0.756 0.846 0.652\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 13/40 8.22G 0.8094 0.4598 1.04 108 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:37\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.5s\n", " all 641 4631 0.809 0.818 0.846 0.643\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 14/40 8.21G 0.794 0.4531 1.032 80 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:36\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.2s\n", " all 641 4631 0.804 0.789 0.84 0.634\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 15/40 8.21G 0.784 0.4393 1.028 71 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:34\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.2s\n", " all 641 4631 0.829 0.768 0.85 0.639\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 16/40 8.25G 0.784 0.4328 1.028 85 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:34\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.2s\n", " all 641 4631 0.833 0.767 0.835 0.628\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 17/40 8.25G 0.7684 0.4227 1.023 64 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:35\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.5s\n", " all 641 4631 0.803 0.838 0.845 0.65\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 18/40 8.22G 0.768 0.4192 1.022 73 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:36\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.7s\n", " all 641 4631 0.815 0.798 0.844 0.666\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 19/40 8.21G 0.7521 0.4073 1.014 76 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:36\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.4s\n", " all 641 4631 0.863 0.804 0.856 0.673\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 20/40 8.12G 0.7468 0.4045 1.014 87 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:37\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.7s\n", " all 641 4631 0.83 0.837 0.855 0.671\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 21/40 8.22G 0.7362 0.3926 1.006 133 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:36\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.7s\n", " all 641 4631 0.856 0.801 0.858 0.672\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 22/40 8.23G 0.7302 0.3866 1.005 83 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:38\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.6s\n", " all 641 4631 0.841 0.809 0.854 0.658\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 23/40 8.22G 0.7194 0.3802 0.9978 94 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:38\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.7s\n", " all 641 4631 0.861 0.826 0.855 0.669\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 24/40 8.22G 0.7177 0.3775 0.9979 72 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:37\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.5s\n", " all 641 4631 0.84 0.819 0.858 0.673\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 25/40 8.21G 0.7047 0.3679 0.9901 76 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:37\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.5s\n", " all 641 4631 0.859 0.816 0.857 0.674\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 26/40 8.22G 0.7016 0.3647 0.9915 57 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:36\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.9s\n", " all 641 4631 0.867 0.808 0.857 0.676\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 27/40 8.25G 0.6975 0.3601 0.9869 100 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:36\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.4s\n", " all 641 4631 0.846 0.844 0.855 0.669\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 28/40 8.11G 0.6855 0.3542 0.9852 96 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:36\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.5s\n", " all 641 4631 0.852 0.836 0.861 0.678\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 29/40 8.27G 0.6734 0.3514 0.976 119 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:35\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.3s\n", " all 641 4631 0.864 0.834 0.866 0.682\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 30/40 8.22G 0.6738 0.3449 0.98 71 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:36\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.5s\n", " all 641 4631 0.869 0.838 0.865 0.692\n", "Closing dataloader mosaic\n", "\u001b[34m\u001b[1malbumentations: \u001b[0mBlur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01, method='weighted_average', num_output_channels=3), CLAHE(p=0.01, clip_limit=(1.0, 4.0), tile_grid_size=(8, 8))\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 31/40 8.2G 0.6234 0.2961 0.9697 52 800: 100% ━━━━━━━━━━━━ 563/563 1.4it/s 6:36\n", "\u001b[K Class Images Instances Box(P R mAP50 mAP50-95): 100% ━━━━━━━━━━━━ 41/41 2.1it/s 19.5s\n", " all 641 4631 0.874 0.835 0.859 0.689\n", "\n", " Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size\n", "\u001b[K 32/40 8.2G 0.6028 0.2913 0.9546 55 800: 19% ━━────────── 105/563 2.1it/s 1:15<3:34\n" ] }, { "output_type": "error", "ename": "KeyboardInterrupt", "evalue": "", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", "\u001b[0;32m/tmp/ipykernel_265/1365922912.py\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m model.train(\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34mf\"{dataset.location}/data.yaml\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mepochs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m40\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0mimgsz\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m800\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0mbatch\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m8\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/ultralytics/engine/model.py\u001b[0m in \u001b[0;36mtrain\u001b[0;34m(self, trainer, **kwargs)\u001b[0m\n\u001b[1;32m 775\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrainer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmodel\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 776\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 777\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrainer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrain\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 778\u001b[0m \u001b[0;31m# Update model and cfg after training\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 779\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mRANK\u001b[0m \u001b[0;32min\u001b[0m \u001b[0;34m{\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/ultralytics/engine/trainer.py\u001b[0m in \u001b[0;36mtrain\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 242\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 243\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 244\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_do_train\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 245\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 246\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_setup_scheduler\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/ultralytics/engine/trainer.py\u001b[0m in \u001b[0;36m_do_train\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 434\u001b[0m \u001b[0mloss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mloss_items\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0munwrap_model\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmodel\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mloss\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbatch\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpreds\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 435\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 436\u001b[0;31m \u001b[0mloss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mloss_items\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmodel\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbatch\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 437\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mloss\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mloss\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msum\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 438\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mRANK\u001b[0m \u001b[0;34m!=\u001b[0m \u001b[0;34m-\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_wrapped_call_impl\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 1774\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_compiled_call_impl\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# type: ignore[misc]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1775\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1776\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_call_impl\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1777\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1778\u001b[0m \u001b[0;31m# torchrec tests the code consistency with the following code\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py\u001b[0m in \u001b[0;36m_call_impl\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 1785\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0m_global_backward_pre_hooks\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0m_global_backward_hooks\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1786\u001b[0m or _global_forward_hooks or _global_forward_pre_hooks):\n\u001b[0;32m-> 1787\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mforward_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1788\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1789\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/ultralytics/nn/tasks.py\u001b[0m in \u001b[0;36mforward\u001b[0;34m(self, x, *args, **kwargs)\u001b[0m\n\u001b[1;32m 139\u001b[0m \"\"\"\n\u001b[1;32m 140\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdict\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;31m# for cases of training and validating while training.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 141\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mloss\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 142\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpredict\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 143\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/ultralytics/nn/tasks.py\u001b[0m in \u001b[0;36mloss\u001b[0;34m(self, batch, preds)\u001b[0m\n\u001b[1;32m 333\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mpreds\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 334\u001b[0m \u001b[0mpreds\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mforward\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbatch\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"img\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 335\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcriterion\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpreds\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbatch\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 336\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 337\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0minit_criterion\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/ultralytics/utils/loss.py\u001b[0m in \u001b[0;36m__call__\u001b[0;34m(self, preds, batch)\u001b[0m\n\u001b[1;32m 460\u001b[0m ) -> tuple[torch.Tensor, torch.Tensor]:\n\u001b[1;32m 461\u001b[0m \u001b[0;34m\"\"\"Calculate the sum of the loss for box, cls and dfl multiplied by batch size.\"\"\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 462\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mloss\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mparse_output\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpreds\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbatch\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 463\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 464\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mloss\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpreds\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mdict\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mstr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mTensor\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbatch\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mdict\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mstr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mTensor\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mtuple\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mTensor\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mTensor\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/ultralytics/utils/loss.py\u001b[0m in \u001b[0;36mloss\u001b[0;34m(self, preds, batch)\u001b[0m\n\u001b[1;32m 465\u001b[0m \u001b[0;34m\"\"\"Calculate detection loss using assigned targets.\"\"\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 466\u001b[0m \u001b[0mbatch_size\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpreds\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"boxes\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 467\u001b[0;31m \u001b[0mloss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mloss_detach\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_assigned_targets_and_loss\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpreds\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbatch\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 468\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mloss\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0mbatch_size\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mloss_detach\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 469\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/ultralytics/utils/loss.py\u001b[0m in \u001b[0;36mget_assigned_targets_and_loss\u001b[0;34m(self, preds, batch)\u001b[0m\n\u001b[1;32m 396\u001b[0m \u001b[0mpreds\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"scores\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpermute\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m2\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcontiguous\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 397\u001b[0m )\n\u001b[0;32m--> 398\u001b[0;31m \u001b[0manchor_points\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstride_tensor\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmake_anchors\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpreds\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"feats\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstride\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0.5\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 399\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 400\u001b[0m \u001b[0mdtype\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpred_scores\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdtype\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.12/dist-packages/ultralytics/utils/tal.py\u001b[0m in \u001b[0;36mmake_anchors\u001b[0;34m(feats, strides, grid_cell_offset)\u001b[0m\n\u001b[1;32m 409\u001b[0m \u001b[0msy\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msx\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmeshgrid\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msy\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mindexing\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"ij\"\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mTORCH_1_11\u001b[0m \u001b[0;32melse\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmeshgrid\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msy\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 410\u001b[0m \u001b[0manchor_points\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstack\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msy\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m-\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mview\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 411\u001b[0;31m \u001b[0mstride_tensor\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfull\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mh\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0mw\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstride\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdtype\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdtype\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdevice\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdevice\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 412\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0manchor_points\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtorch\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mstride_tensor\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 413\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;31mKeyboardInterrupt\u001b[0m: " ] } ] }, { "cell_type": "code", "source": [ "from google.colab import files\n", "\n", "files.download(\"runs/detect/train/weights/best.pt\")" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 17 }, "id": "RJ9TDmmyFchc", "outputId": "838a8bb9-82cd-4405-c216-5796d8b7f17e" }, "execution_count": 8, "outputs": [ { "output_type": "display_data", "data": { "text/plain": [ "" ], "application/javascript": [ "\n", " async function download(id, filename, size) {\n", " if (!google.colab.kernel.accessAllowed) {\n", " return;\n", " }\n", " const div = document.createElement('div');\n", " const label = document.createElement('label');\n", " label.textContent = `Downloading \"${filename}\": `;\n", " div.appendChild(label);\n", " const progress = document.createElement('progress');\n", " progress.max = size;\n", " div.appendChild(progress);\n", " document.body.appendChild(div);\n", "\n", " const buffers = [];\n", " let downloaded = 0;\n", "\n", " const channel = await google.colab.kernel.comms.open(id);\n", " // Send a message to notify the kernel that we're ready.\n", " channel.send({})\n", "\n", " for await (const message of channel.messages) {\n", " // Send a message to notify the kernel that we're ready.\n", " channel.send({})\n", " if (message.buffers) {\n", " for (const buffer of message.buffers) {\n", " buffers.push(buffer);\n", " downloaded += buffer.byteLength;\n", " progress.value = downloaded;\n", " }\n", " }\n", " }\n", " const blob = new Blob(buffers, {type: 'application/binary'});\n", " const a = document.createElement('a');\n", " a.href = window.URL.createObjectURL(blob);\n", " a.download = filename;\n", " div.appendChild(a);\n", " a.click();\n", " div.remove();\n", " }\n", " " ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "" ], "application/javascript": [ "download(\"download_395df0fc-3865-4f9c-aaf9-b5c4843f47bc\", \"best.pt\", 153284247)" ] }, "metadata": {} } ] }, { "cell_type": "code", "source": [], "metadata": { "id": "anYbbryNXwI7" }, "execution_count": null, "outputs": [] } ], "metadata": { "colab": { "provenance": [], "gpuType": "T4" }, "kernelspec": { "display_name": "Python 3", "name": "python3" }, "language_info": { "name": "python" }, "accelerator": "GPU" }, "nbformat": 4, "nbformat_minor": 0 }