I am working on video and getting frames and using the pretrained model, I tried predict features. I am trying to use GPU and end up having OOM error. Algo looks like
for loop --> for each video
—with torch.no_grad()
-----process video n fetch frames
-----batch frames
-----ft = model(frames)
-----x = torch.cat(ft)
However, memory is full after processing few videos. Should I use
-----x = torch.cat(ft).cpu()
-----del ft, model
I really don’t understand how things are working with tensors in Pytorch. Please let me understand the concept. Thanks