yolov9
yolov9 copied to clipboard
ISSUE: IndexError: list index out of range - while training 'YOLOv9-e' on custom dataset.
I'm trying to train this yolov9-e.pt
model on a custom dataset.
Here's my command-line argument:
!python train_dual.py \ --batch 64 --epochs 25 --img 640 --device 0 --min-items 0 --close-mosaic 15 --workers 4\ --data /content/yolov9/SkyFusion-YOLOv9/data.yaml \ --weights {HOME}/weights/yolov9-e.pt \ --cfg models/detect/yolov9-e.yaml \ --hyp hyp.scratch-high.yaml
However, I keep running into this IndexError: list index out of range
error.
Here's what the traceback looks like:
yolov9-e summary: 1475 layers, 69410930 parameters, 69410898 gradients, 244.9 GFLOPs
Transferred 2160/2172 items from {HOME}/weights/yolov9-e.pt AMP: checks passed ✅ optimizer: SGD(lr=0.01) with parameter groups 356 weight(decay=0.0), 375 weight(decay=0.0005), 373 bias 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)) train: Scanning /content/yolov9/SkyFusion-YOLOv9/train/labels.cache... 2094 images, 0 backgrounds, 0 corrupt: 100% 2094/2094 [00:00<?, ?it/s] val: Scanning /content/yolov9/SkyFusion-YOLOv9/valid/labels.cache... 449 images, 0 backgrounds, 0 corrupt: 100% 449/449 [00:00<?, ?it/s] Plotting labels to runs/train/exp18/labels.jpg... Image sizes 640 train, 640 val Using 2 dataloader workers Logging results to runs/train/exp18 Starting training for 25 epochs...
Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size
0% 0/33 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/content/yolov9/train_dual.py", line 644, in
Can someone please assist with this?
I am also getting the same error I tried the default dataset that was loaded on the yolov9 google collab which is: project = rf.workspace("roboflow-jvuqo").project("football-players-detection-3zvbc") version = project.version(8) dataset = version.download("yolov9") and the code: !python train_dual.py \ --batch 64 --epochs 25 --img 640 --device 0 --min-items 0 --close-mosaic 15 --workers 4\ --data /content/yolov9/SkyFusion-YOLOv9/data.yaml \ --weights {HOME}/weights/yolov9-e.pt \ --cfg models/detect/yolov9-e.yaml \ --hyp hyp.scratch-high.yaml works perfectly but when I use this dataset: project = rf.workspace("zr-testing").project("zrv2") version = project.version(32) dataset = version.download("yolov9") I get the Same error as @pranavdurai10
i have the same problem :(
Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size
0%| | 0/1283 00:00
Traceback (most recent call last):
File "C:\Users\kitag\PycharmProjects\AI\Lab\Yolov9\train.py", line 636, in
@Kitagawayyds @parasmaisalunkhe - Please go ahead with Ultralytics implementation of YOLOv9.
Link: https://docs.ultralytics.com/models/yolov9/
@Kitagawayyds @parasmaisalunkhe - Please go ahead with Ultralytics implementation of YOLOv9.
Link: https://docs.ultralytics.com/models/yolov9/
is this problem solved? (in Ultralytics)
@Kitagawayyds - Yes, I'm able to train both YOLOv9-C and E models on a custom dataset.
I solved my problem basically in roboflow I added Resize: Stretch to 640x640 to my Preproccesing of my dataset which works with the: !python train_dual.py \ --batch 64 --epochs 25 --img 640 --device 0 --min-items 0 --close-mosaic 15 --workers 4\ --data /content/yolov9/SkyFusion-YOLOv9/data.yaml \ --weights {HOME}/weights/yolov9-e.pt \ --cfg models/detect/yolov9-e.yaml \ --hyp hyp.scratch-high.yaml and I thinik the img flag represents 640 by 640 so it works now
@parasmaisalunkhe - in that way, my dataset already had 640x640 images.
It still didn't work.
thanks the ultralytics documentation works now
thanks the ultralytics documentation works now
bro.. could you tell me how did you resolved that issue on IndexError: list index out of range
same issue here I am using this dataset which already has, Resize: Stretch to 640x640 rf = Roboflow(api_key="") project = rf.workspace("university-of-southeastern-philippines-cnl9c").project("license-plate-detection-merged-projects") version = project.version(3) dataset = version.download("yolov9")
!python train.py
--batch 16 --epochs 25 --img 640 --device 0 --min-items 0 --close-mosaic 15
--data {dataset.location}/data.yaml
--weights {HOME}/weights/yolov9-c.pt
--cfg models/detect/yolov9.yaml
--hyp hyp.scratch-high.yaml
please check the error
@parasmaisalunkhe, could you kindly explain how you resized the dataset? I'm not familiar with how to do it using the YAML format from Roboflow.
modify hyp.scratch-high.yaml old copy_paste: 0.3 # segment copy-paste (probability) new copy_paste: 0.1 or 0.0
@googzzgsee not working
Modify the copy_paste
parameter in hyp.scratch-high.yaml
to 0.0 helped me solve the problem.
tysm @ytl0623 it works for me
Modify the
copy_paste
parameter inhyp.scratch-high.yaml
to 0.0 helped me solve the problem.
its working but can you explain the intution behind this ? why is that so ?
Starting training for 5 epochs...
Epoch GPU_mem box_loss cls_loss dfl_loss Instances Size
0/4 1.85G 2.066 3.152 2.312 4 640: 0%| | 0/303 00:02WARNING ⚠️ TensorBoard graph visualization failure Only tensors, lists, tuples of tensors, or dictionary of tensors can be output from traced functions
0/4 2.89G 2.106 4.011 2.589 1 640: 100%|██████████| 303/303 04:18
Class Images Instances P R mAP50 mAP50-95: 0%| | 0/11 00:00si: 0, len(paths): 2, len(shapes): 2
si: 1, len(paths): 2, len(shapes): 2
Class Images Instances P R mAP50 mAP50-95: 0%| | 0/11 00:00
Traceback (most recent call last):
File "train_dual.py", line 644, in
Modify the
copy_paste
parameter inhyp.scratch-high.yaml
to 0.0 helped me solve the problem.
it is working..thank you