hkchengrex / XMem

[ECCV 2022] XMem: Long-Term Video Object Segmentation with an Atkinson-Shiffrin Memory Model
https://hkchengrex.com/XMem/
MIT License
1.72k stars 191 forks source link

Error when training - read memory #128

Closed yarinbar closed 10 months ago

yarinbar commented 10 months ago

I was trying to run the code with my dataset and got this error:

File "C:\Users\yarinbar\cathAlert\cathalert\src\models\xmem2\model\trainer.py", line 104, in do_pass
memory_readout = self.XMem('read_memory', key[:,:,ti], selection[:,:,ti] if selection is not None else None,  IndexError: index 5 is out of bounds for dimension 2 with size 5

Then I tried to use the Davis dataset and got the exact same error. I took a screen shot of all the variables from the line it went bad at:

image

To me it looked like the for statement in line 81 was causing this as it starts with 1: for ti in range(1, self.num_frames)

But i tried to change it without success. From the looks of it, the dimensions are not in the correct order but I did not do anything to change the order.

Would appreciate any help, thanks!

yarinbar commented 10 months ago

I mistaken the batch size which is 8 to the number of frames i used which i changed to 5 but did not update the config.