MovieChat icon indicating copy to clipboard operation
MovieChat copied to clipboard

Run long video

Open shuyansy opened this issue 10 months ago • 8 comments

Thanks for your work. I want to test my long video and set the middle_video to 0. However, i met this error. Could you help me to provide some solutions? Thanks so much!

截屏2024-04-26 下午9 24 11

shuyansy avatar Apr 26 '24 13:04 shuyansy

I think I have fixed the bug before. Can u tell me which code u use? The error often occurs when u didn't initialize the long-term memory when update a new long video.

Espere-1119-Song avatar Apr 27 '24 05:04 Espere-1119-Song

Hi, I just run the main branch. Moreover, i found "# middle_video = middle_video == 1" In line 368 in inference.py, So I delete it Do you have any ideas. Thanks so much for your reply!

shuyansy avatar Apr 28 '24 02:04 shuyansy

image I think line 368 is not commented out.

Espere-1119-Song avatar Apr 28 '24 04:04 Espere-1119-Song

Thanks so much! The code can run normally. However, I want to read more frames so I adjust " N_SAMPLES = 128", when I use larger number, the error still occurs. Do you have any ideas? Thanks for your time and response!

shuyansy avatar Apr 28 '24 14:04 shuyansy

I think you need to check the actual length of positional embedding.

Espere-1119-Song avatar Apr 29 '24 02:04 Espere-1119-Song

Thanks for the response. I expand "n_position = 16" to" n_position = 32" so it can support more frames. However I found the max value is 32 due to the size of the pretrained model. Thus, the max frame to model is about 500. Is my understanding right?

shuyansy avatar Apr 29 '24 05:04 shuyansy

I think you can explore it by checking the length of long-term memory :). The max frame read by the model is len(short-term memory) * len(long-term memory) / 2

Espere-1119-Song avatar Apr 29 '24 05:04 Espere-1119-Song

Thanks for reminder! The last question I want to check is whether my hyperparameter setting is right: cur_sec=1 cur_min=1 If I want to read the whole long video.

shuyansy avatar Apr 29 '24 05:04 shuyansy