YuHengsss / YOLOV

This repo is an implementation of PyTorch version YOLOV Series
Apache License 2.0
309 stars 43 forks source link

what will happen if batch_size != gframe (lframe=0) ? #20

Closed ResonWang closed 1 year ago

ResonWang commented 1 year ago

Dear auther, I found that if batch_size != gframe (e.g., batchsize=32, gframe=16 and lframe=0) which means one batch contains two groups (16 frames each x2), all the predictions of two groups of 32 frames will be used to conduct the MSA related processing. But the two groups of frames possibly come from two different videos, won't it have some problems ? If setting batch_size = gframe = a small value (e.g. 16), the problem does not exist, but the GPU Memory utilization will be very low. If setting batch_size = gframe = a big value (e.g. 64), that means making a decision during inference needs to consider 64 frames. So I don't know if I missed something ? How should I set batch_size and gframe\lframe on my 2x24GB gpus ?

YuHengsss commented 1 year ago

For the first problem, please set batch size = gframe+lframe. We should mention that in our code and thanks for your problem. In this version, one batch is only for one video but you can change the code in the dataloader and detection head for supporting multi-video per batch. For exploring other strategies such as MEGA which requires both gframe and lframe in the future, the batch size and gframe are set separately. We don't utilize multi GPUs due to my poor coding... I will try to add code for supporting multi-card training but it may take some time. But we are welcome to pull requests.

ResonWang commented 1 year ago

Thanks, but your code can work well on two gpus due to the DDP you applied. Maybe you missed something ?

Zhugedaqing commented 1 year ago

Thanks, but your code can work well on two gpus due to the DDP you applied. Maybe you missed something ?

Zhugedaqing commented 1 year ago

hello,could you give me more thing about what parameters do I need to adjust to train with two Gpus