yolov9 icon indicating copy to clipboard operation
yolov9 copied to clipboard

IndexError: list index out of range

Open AndrewHawking opened this issue 11 months ago • 17 comments

Traceback (most recent call last): File "D:\yolov9-main\train.py", line 634, in main(opt) File "D:\yolov9-main\train.py", line 528, in main train(opt.hyp, opt, device, callbacks) File "D:\yolov9-main\train.py", line 345, in train results, maps, _ = validate.run(data_dict, ^^^^^^^^^^^^^^^^^^^^^^^ File "D:\anaconda\envs\yolo\Lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "D:\yolov9-main\val.py", line 213, in run path, shape = Path(paths[si][0]), shapes[si][0] ~~~~~^^^^ IndexError: list index out of range

how should i fix it ? pls

AndrewHawking avatar Mar 04 '24 12:03 AndrewHawking

hello,I think you should using the moudel named 'yolov9-c.pt' or 'yolov9-e.pt' instead of 'gelan-xx.pt'

DASDSAJCA avatar Mar 04 '24 13:03 DASDSAJCA

Hi.

What were you doing? Which weight are you using? Which arguments did you run the script with?

I was training my model yesterday and I discovered that I need to use train_dual.py with certain weights, such as gelan-c and yolov9-converted.

Maybe that is your issue. Try running train_dual.py with your arguments.

Have a great day.

moralesja560 avatar Mar 04 '24 15:03 moralesja560

hello,I think you should using the moudel named 'yolov9-c.pt' or 'yolov9-e.pt' instead of 'gelan-xx.pt'

thanks

AndrewHawking avatar Mar 05 '24 00:03 AndrewHawking

Hi.

What were you doing? Which weight are you using? Which arguments did you run the script with?

I was training my model yesterday and I discovered that I need to use train_dual.py with certain weights, such as gelan-c and yolov9-converted.

Maybe that is your issue. Try running train_dual.py with your arguments.

Have a great day.

thanks

AndrewHawking avatar Mar 05 '24 00:03 AndrewHawking

running train_dual.py not error, but the map always zero!!that's why?

Capricorn-18 avatar Mar 05 '24 14:03 Capricorn-18

我也遇到了相同的问题,请问您解决了吗?

Tong-Hao741 avatar Mar 13 '24 06:03 Tong-Hao741

Maybe you can try to modify the copy_paste parameter in hyp.scratch-high.yaml to 0.0. image

I solved the problem by this method.

ytl0623 avatar Mar 22 '24 07:03 ytl0623

thank u,i will try again :)

Tong-Hao741 avatar Mar 23 '24 01:03 Tong-Hao741

https://github.com/WongKinYiu/yolov9/pull/13/files its wroked,may you can try.

 with dt[2]:
      preds = preds[0][1] if isinstance(preds[0], list) else preds[0]#add

xinlin-xiao avatar May 15 '24 06:05 xinlin-xiao

WoW,thank u very much,it work~

Tong-Hao741 avatar May 15 '24 06:05 Tong-Hao741

https://github.com/WongKinYiu/yolov9/pull/13/files 它的工作原理,你可以尝试一下。

 with dt[2]:
      preds = preds[0][1] if isinstance(preds[0], list) else preds[0]#add

Where to add it?

wenshihao1 avatar May 21 '24 09:05 wenshihao1

https://github.com/WongKinYiu/yolov9/pull/13/files 它的工作原理,你可以尝试一下。

 with dt[2]:
      preds = preds[0][1] if isinstance(preds[0], list) else preds[0]#add

Where to add it?

detect.py

xinlin-xiao avatar May 21 '24 10:05 xinlin-xiao

But I had a problem when I was training.

---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2024年05月21日 19:29 | | 收件人 | @.> | | 抄送至 | @.>@.> | | 主题 | Re: [WongKinYiu/yolov9] IndexError: list index out of range (Issue #157) |

https://github.com/WongKinYiu/yolov9/pull/13/files 它的工作原理,你可以尝试一下。

with dt[2]: preds = preds[0][1] if isinstance(preds[0], list) else preds[0]#add

Where to add it?

detect.py

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

wenshihao1 avatar May 21 '24 10:05 wenshihao1

try add it to val.py.

---Original--- From: @.> Date: Tue, May 21, 2024 18:32 PM To: @.>; Cc: @.@.>; Subject: Re: [WongKinYiu/yolov9] IndexError: list index out of range (Issue#157)

But I had a problem when I was training.

---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2024年05月21日 19:29 | | 收件人 | @.> | | 抄送至 | @.>@.> | | 主题 | Re: [WongKinYiu/yolov9] IndexError: list index out of range (Issue #157) |

https://github.com/WongKinYiu/yolov9/pull/13/files 它的工作原理,你可以尝试一下。

with dt[2]: preds = preds[0][1] if isinstance(preds[0], list) else preds[0]#add

Where to add it?

detect.py

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.> — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>

xinlin-xiao avatar May 21 '24 10:05 xinlin-xiao

Didn't find a place to add in val.py

---- Replied Message ---- | From | @.> | | Date | 05/21/2024 19:40 | | To | @.> | | Cc | @.>@.> | | Subject | Re: [WongKinYiu/yolov9] IndexError: list index out of range (Issue #157) |

try add it to val.py.

---Original--- From: @.> Date: Tue, May 21, 2024 18:32 PM To: @.>; Cc: @.@.>; Subject: Re: [WongKinYiu/yolov9] IndexError: list index out of range (Issue#157)

But I had a problem when I was training.

---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2024年05月21日 19:29 | | 收件人 | @.> | | 抄送至 | @.>@.> | | 主题 | Re: [WongKinYiu/yolov9] IndexError: list index out of range (Issue #157) |

https://github.com/WongKinYiu/yolov9/pull/13/files 它的工作原理,你可以尝试一下。

with dt[2]: preds = preds[0][1] if isinstance(preds[0], list) else preds[0]#add

Where to add it?

detect.py

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.> — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

wenshihao1 avatar May 21 '24 10:05 wenshihao1

before nms

---Original--- From: @.> Date: Tue, May 21, 2024 18:46 PM To: @.>; Cc: @.@.>; Subject: Re: [WongKinYiu/yolov9] IndexError: list index out of range (Issue#157)

Didn't find a place to add in val.py

---- Replied Message ---- | From | @.> | | Date | 05/21/2024 19:40 | | To | @.> | | Cc | @.>@.> | | Subject | Re: [WongKinYiu/yolov9] IndexError: list index out of range (Issue #157) |

try add it to val.py.

---Original--- From: @.> Date: Tue, May 21, 2024 18:32 PM To: @.>; Cc: @.@.>; Subject: Re: [WongKinYiu/yolov9] IndexError: list index out of range (Issue#157)

But I had a problem when I was training.

---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2024年05月21日 19:29 | | 收件人 | @.> | | 抄送至 | @.>@.> | | 主题 | Re: [WongKinYiu/yolov9] IndexError: list index out of range (Issue #157) |

https://github.com/WongKinYiu/yolov9/pull/13/files 它的工作原理,你可以尝试一下。

with dt[2]: preds = preds[0][1] if isinstance(preds[0], list) else preds[0]#add

Where to add it?

detect.py

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.> — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.> — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>

xinlin-xiao avatar May 21 '24 10:05 xinlin-xiao

ok, I will try. Thanks.

---- Replied Message ---- | From | @.> | | Date | 05/21/2024 19:54 | | To | @.> | | Cc | @.>@.> | | Subject | Re: [WongKinYiu/yolov9] IndexError: list index out of range (Issue #157) |

before nms

---Original--- From: @.> Date: Tue, May 21, 2024 18:46 PM To: @.>; Cc: @.@.>; Subject: Re: [WongKinYiu/yolov9] IndexError: list index out of range (Issue#157)

Didn't find a place to add in val.py

---- Replied Message ---- | From | @.> | | Date | 05/21/2024 19:40 | | To | @.> | | Cc | @.>@.> | | Subject | Re: [WongKinYiu/yolov9] IndexError: list index out of range (Issue #157) |

try add it to val.py.

---Original--- From: @.> Date: Tue, May 21, 2024 18:32 PM To: @.>; Cc: @.@.>; Subject: Re: [WongKinYiu/yolov9] IndexError: list index out of range (Issue#157)

But I had a problem when I was training.

---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2024年05月21日 19:29 | | 收件人 | @.> | | 抄送至 | @.>@.> | | 主题 | Re: [WongKinYiu/yolov9] IndexError: list index out of range (Issue #157) |

https://github.com/WongKinYiu/yolov9/pull/13/files 它的工作原理,你可以尝试一下。

with dt[2]: preds = preds[0][1] if isinstance(preds[0], list) else preds[0]#add

Where to add it?

detect.py

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.> — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.> — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

wenshihao1 avatar May 21 '24 11:05 wenshihao1