I am feeding (frames,h,w,3) images in vgg19 from which the extracted features (frames,512) are fed in lstm layer. On keeping batch size = 1, maximum frames in a video are 300 and size is 224X224. I am getting out of memory error. How can I resolve this and do the task in memory efficient way?