OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Yolo V5 Gets stuck, doesn't show any error too in Google Colab

  • Thread starter Thread starter Abdul Salam
  • Start date Start date
A

Abdul Salam

Guest
Code:
!yolo task=detect mode=train model=yolov5x.pt data={dataset.location}/data.yaml epochs=100 imgsz=640

This is the input code

The output is as given below :

Code:
Downloading https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov5xu.pt to 'yolov5xu.pt'...
100% 186M/186M [00:00<00:00, 365MB/s]
Ultralytics YOLOv8.2.42 🚀 Python-3.10.12 torch-2.3.0+cu121 CPU (Intel Xeon 2.20GHz)
engine/trainer: task=detect, mode=train, model=yolov5x.pt, data=/content/football-players-detection-1/data.yaml, epochs=100, time=None, patience=100, batch=16, imgsz=640, save=True, save_period=-1, cache=False, device=None, workers=8, project=None, name=train, exist_ok=False, pretrained=True, optimizer=auto, verbose=True, seed=0, deterministic=True, single_cls=False, rect=False, cos_lr=False, close_mosaic=10, resume=False, amp=True, fraction=1.0, profile=False, freeze=None, multi_scale=False, overlap_mask=True, mask_ratio=4, dropout=0.0, val=True, split=val, save_json=False, save_hybrid=False, conf=None, iou=0.7, max_det=300, half=False, dnn=False, plots=True, source=None, vid_stride=1, stream_buffer=False, visualize=False, augment=False, agnostic_nms=False, classes=None, retina_masks=False, embed=None, show=False, save_frames=False, save_txt=False, save_conf=False, save_crop=False, show_labels=True, show_conf=True, show_boxes=True, line_width=None, format=torchscript, keras=False, optimize=False, int8=False, dynamic=False, simplify=False, opset=None, workspace=4, nms=False, 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=7.5, cls=0.5, dfl=1.5, pose=12.0, kobj=1.0, label_smoothing=0.0, nbs=64, 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, bgr=0.0, mosaic=1.0, mixup=0.0, copy_paste=0.0, auto_augment=randaugment, erasing=0.4, crop_fraction=1.0, cfg=None, tracker=botsort.yaml, save_dir=runs/detect/train
Downloading https://ultralytics.com/assets/Arial.ttf to '/root/.config/Ultralytics/Arial.ttf'...
100% 755k/755k [00:00<00:00, 95.1MB/s]
Overriding model.yaml nc=80 with nc=4

                   from  n    params  module                                       arguments                     
  0                  -1  1      8800  ultralytics.nn.modules.conv.Conv             [3, 80, 6, 2, 2]              
  1                  -1  1    115520  ultralytics.nn.modules.conv.Conv             [80, 160, 3, 2]               
  2                  -1  4    309120  ultralytics.nn.modules.block.C3              [160, 160, 4]                 
  3                  -1  1    461440  ultralytics.nn.modules.conv.Conv             [160, 320, 3, 2]              
  4                  -1  8   2259200  ultralytics.nn.modules.block.C3              [320, 320, 8]                 
  5                  -1  1   1844480  ultralytics.nn.modules.conv.Conv             [320, 640, 3, 2]              
  6                  -1 12  13125120  ultralytics.nn.modules.block.C3              [640, 640, 12]                
  7                  -1  1   7375360  ultralytics.nn.modules.conv.Conv             [640, 1280, 3, 2]             
  8                  -1  4  19676160  ultralytics.nn.modules.block.C3              [1280, 1280, 4]               
  9                  -1  1   4099840  ultralytics.nn.modules.block.SPPF            [1280, 1280, 5]               
 10                  -1  1    820480  ultralytics.nn.modules.conv.Conv             [1280, 640, 1, 1]             
 11                  -1  1         0  torch.nn.modules.upsampling.Upsample         [None, 2, 'nearest']          
 12             [-1, 6]  1         0  ultralytics.nn.modules.conv.Concat           [1]                           
 13                  -1  4   5332480  ultralytics.nn.modules.block.C3              [1280, 640, 4, False]         
 14                  -1  1    205440  ultralytics.nn.modules.conv.Conv             [640, 320, 1, 1]              
 15                  -1  1         0  torch.nn.modules.upsampling.Upsample         [None, 2, 'nearest']          
 16             [-1, 4]  1         0  ultralytics.nn.modules.conv.Concat           [1]                           
 17                  -1  4   1335040  ultralytics.nn.modules.block.C3              [640, 320, 4, False]          
 18                  -1  1    922240  ultralytics.nn.modules.conv.Conv             [320, 320, 3, 2]              
 19            [-1, 14]  1         0  ultralytics.nn.modules.conv.Concat           [1]                           
 20                  -1  4   4922880  ultralytics.nn.modules.block.C3              [640, 640, 4, False]          
 21                  -1  1   3687680  ultralytics.nn.modules.conv.Conv             [640, 640, 3, 2]              
 22            [-1, 10]  1         0  ultralytics.nn.modules.conv.Concat           [1]                           
 23                  -1  4  19676160  ultralytics.nn.modules.block.C3              [1280, 1280, 4, False]        
 24        [17, 20, 23]  1  11025820  ultralytics.nn.modules.head.Detect           [4, [320, 640, 1280]]         
YOLOv5x summary: 493 layers, 97203260 parameters, 97203244 gradients, 246.9 GFLOPs

Transferred 817/823 items from pretrained weights
TensorBoard: Start with 'tensorboard --logdir runs/detect/train', view at http://localhost:6006/
Freezing layer 'model.24.dfl.conv.weight'
train: Scanning /content/football-players-detection-1/football-players-detection-1/train/labels... 612 images, 0 backgrounds, 0 corrupt: 100% 612/612 [00:00<00:00, 1644.29it/s]
train: New cache created: /content/football-players-detection-1/football-players-detection-1/train/labels.cache
albumentations: Blur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01), CLAHE(p=0.01, clip_limit=(1, 4.0), tile_grid_size=(8, 8))
val: Scanning /content/football-players-detection-1/football-players-detection-1/valid/labels... 38 images, 0 backgrounds, 0 corrupt: 100% 38/38 [00:00<00:00, 1625.62it/s]
val: New cache created: /content/football-players-detection-1/football-players-detection-1/valid/labels.cache
Plotting labels to runs/detect/train/labels.jpg... 
optimizer: 'optimizer=auto' found, ignoring 'lr0=0.01' and 'momentum=0.937' and determining best 'optimizer', 'lr0' and 'momentum' automatically... 
optimizer: AdamW(lr=0.00125, momentum=0.9) with parameter groups 135 weight(decay=0.0), 142 weight(decay=0.0005), 141 bias(decay=0.0)
TensorBoard: model graph visualization added ✅
Image sizes 640 train, 640 val
Using 0 dataloader workers
Logging results to runs/detect/train
Starting training for 100 epochs...

      Epoch    GPU_mem   box_loss   cls_loss   dfl_loss  Instances       Size
  0% 0/39 [00:00<?, ?it/s]^C

If you see at the end, the epoch doesn't run at all, it doesn't list each of the epochs, but the google colab shows it ran successfully. After running it show give me 2 files, the best weight and the last weight

enter image description here

I was expecting something like this It should give me the best.pt and the last.pt file
<pre><code>!yolo task=detect mode=train model=yolov5x.pt data={dataset.location}/data.yaml epochs=100 imgsz=640
</code></pre>
<p>This is the input code</p>
<p>The output is as given below :</p>
<pre><code>Downloading https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov5xu.pt to 'yolov5xu.pt'...
100% 186M/186M [00:00<00:00, 365MB/s]
Ultralytics YOLOv8.2.42 🚀 Python-3.10.12 torch-2.3.0+cu121 CPU (Intel Xeon 2.20GHz)
engine/trainer: task=detect, mode=train, model=yolov5x.pt, data=/content/football-players-detection-1/data.yaml, epochs=100, time=None, patience=100, batch=16, imgsz=640, save=True, save_period=-1, cache=False, device=None, workers=8, project=None, name=train, exist_ok=False, pretrained=True, optimizer=auto, verbose=True, seed=0, deterministic=True, single_cls=False, rect=False, cos_lr=False, close_mosaic=10, resume=False, amp=True, fraction=1.0, profile=False, freeze=None, multi_scale=False, overlap_mask=True, mask_ratio=4, dropout=0.0, val=True, split=val, save_json=False, save_hybrid=False, conf=None, iou=0.7, max_det=300, half=False, dnn=False, plots=True, source=None, vid_stride=1, stream_buffer=False, visualize=False, augment=False, agnostic_nms=False, classes=None, retina_masks=False, embed=None, show=False, save_frames=False, save_txt=False, save_conf=False, save_crop=False, show_labels=True, show_conf=True, show_boxes=True, line_width=None, format=torchscript, keras=False, optimize=False, int8=False, dynamic=False, simplify=False, opset=None, workspace=4, nms=False, 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=7.5, cls=0.5, dfl=1.5, pose=12.0, kobj=1.0, label_smoothing=0.0, nbs=64, 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, bgr=0.0, mosaic=1.0, mixup=0.0, copy_paste=0.0, auto_augment=randaugment, erasing=0.4, crop_fraction=1.0, cfg=None, tracker=botsort.yaml, save_dir=runs/detect/train
Downloading https://ultralytics.com/assets/Arial.ttf to '/root/.config/Ultralytics/Arial.ttf'...
100% 755k/755k [00:00<00:00, 95.1MB/s]
Overriding model.yaml nc=80 with nc=4

from n params module arguments
0 -1 1 8800 ultralytics.nn.modules.conv.Conv [3, 80, 6, 2, 2]
1 -1 1 115520 ultralytics.nn.modules.conv.Conv [80, 160, 3, 2]
2 -1 4 309120 ultralytics.nn.modules.block.C3 [160, 160, 4]
3 -1 1 461440 ultralytics.nn.modules.conv.Conv [160, 320, 3, 2]
4 -1 8 2259200 ultralytics.nn.modules.block.C3 [320, 320, 8]
5 -1 1 1844480 ultralytics.nn.modules.conv.Conv [320, 640, 3, 2]
6 -1 12 13125120 ultralytics.nn.modules.block.C3 [640, 640, 12]
7 -1 1 7375360 ultralytics.nn.modules.conv.Conv [640, 1280, 3, 2]
8 -1 4 19676160 ultralytics.nn.modules.block.C3 [1280, 1280, 4]
9 -1 1 4099840 ultralytics.nn.modules.block.SPPF [1280, 1280, 5]
10 -1 1 820480 ultralytics.nn.modules.conv.Conv [1280, 640, 1, 1]
11 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest']
12 [-1, 6] 1 0 ultralytics.nn.modules.conv.Concat [1]
13 -1 4 5332480 ultralytics.nn.modules.block.C3 [1280, 640, 4, False]
14 -1 1 205440 ultralytics.nn.modules.conv.Conv [640, 320, 1, 1]
15 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest']
16 [-1, 4] 1 0 ultralytics.nn.modules.conv.Concat [1]
17 -1 4 1335040 ultralytics.nn.modules.block.C3 [640, 320, 4, False]
18 -1 1 922240 ultralytics.nn.modules.conv.Conv [320, 320, 3, 2]
19 [-1, 14] 1 0 ultralytics.nn.modules.conv.Concat [1]
20 -1 4 4922880 ultralytics.nn.modules.block.C3 [640, 640, 4, False]
21 -1 1 3687680 ultralytics.nn.modules.conv.Conv [640, 640, 3, 2]
22 [-1, 10] 1 0 ultralytics.nn.modules.conv.Concat [1]
23 -1 4 19676160 ultralytics.nn.modules.block.C3 [1280, 1280, 4, False]
24 [17, 20, 23] 1 11025820 ultralytics.nn.modules.head.Detect [4, [320, 640, 1280]]
YOLOv5x summary: 493 layers, 97203260 parameters, 97203244 gradients, 246.9 GFLOPs

Transferred 817/823 items from pretrained weights
TensorBoard: Start with 'tensorboard --logdir runs/detect/train', view at http://localhost:6006/
Freezing layer 'model.24.dfl.conv.weight'
train: Scanning /content/football-players-detection-1/football-players-detection-1/train/labels... 612 images, 0 backgrounds, 0 corrupt: 100% 612/612 [00:00<00:00, 1644.29it/s]
train: New cache created: /content/football-players-detection-1/football-players-detection-1/train/labels.cache
albumentations: Blur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01), CLAHE(p=0.01, clip_limit=(1, 4.0), tile_grid_size=(8, 8))
val: Scanning /content/football-players-detection-1/football-players-detection-1/valid/labels... 38 images, 0 backgrounds, 0 corrupt: 100% 38/38 [00:00<00:00, 1625.62it/s]
val: New cache created: /content/football-players-detection-1/football-players-detection-1/valid/labels.cache
Plotting labels to runs/detect/train/labels.jpg...
optimizer: 'optimizer=auto' found, ignoring 'lr0=0.01' and 'momentum=0.937' and determining best 'optimizer', 'lr0' and 'momentum' automatically...
optimizer: AdamW(lr=0.00125, momentum=0.9) with parameter groups 135 weight(decay=0.0), 142 weight(decay=0.0005), 141 bias(decay=0.0)
TensorBoard: model graph visualization added ✅
Image sizes 640 train, 640 val
Using 0 dataloader workers
Logging results to runs/detect/train
Starting training for 100 epochs...

Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size
0% 0/39 [00:00<?, ?it/s]^C
</code></pre>
<p>If you see at the end, the epoch doesn't run at all, it doesn't list each of the epochs, but the google colab shows it ran successfully.
After running it show give me 2 files, the best weight and the last weight</p>
<p><a href="https://i.sstatic.net/iVFO0tHj.jpg" rel="nofollow noreferrer">enter image description here</a></p>
<p>I was expecting something like this
It should give me the <code>best.pt</code> and the <code>last.pt</code> file</p>
 

Latest posts

I
Replies
0
Views
1
Isaac P. Liu
I
U
Replies
0
Views
1
user3658366
U
G
Replies
0
Views
1
Giampaolo Levorato
G
M
Replies
0
Views
1
Marcelo Rodrigo Nascimento
M
Top