ELM icon indicating copy to clipboard operation
ELM copied to clipboard

Question Regarding AttributeError in ELMDataset Class

Open fubai-666 opened this issue 1 year ago • 3 comments

I'm trying to replicate the ELM project, but I've encountered an error. Specifically, in the file elm_datasets.py, I receive the following error: File "/workspace/nkh1szh/ELM/lavis/datasets/datasets/elm_datasets.py", line 402, in getitem tmp_imglist = self.tmp_imglist[index] AttributeError: 'ELMDataset' object has no attribute 'tmp_imglist'

I initialized tmp_imglist as an empty list (tmp_imglist=[]) within the ELMDataset class. However, when executing the getitem() method, it throws a list index out of range error for tmp_imglist. Does the default_drivelm() function need to handle tmp_imglist in some way to ensure it is populated correctly before accessing it in getitem()?

Thank you for your help!

fubai-666 avatar Sep 25 '24 08:09 fubai-666

I encountered the same problem.

Dangdd avatar Oct 09 '24 08:10 Dangdd

I encountered the same problem.

I added "self.tmp_imglist.append([image_path]*self.temporal_length)" in the default_drivelm() function and set temporal_length=2, finally it succeed running ,but in the middle of the first epoch of training, it reported images[index] out of range in the getitem(self, index) function.

fubai-666 avatar Oct 09 '24 09:10 fubai-666

I got the same problem.

Liuxueyi avatar Oct 10 '24 01:10 Liuxueyi

Hello, we have fixed the bug in the code, you can check it out.

zhouyunsong avatar Jan 02 '25 08:01 zhouyunsong