The following code dies because of out of memory.
images # Variable of size 2000 * 3 * 224 * 224 (N * C * H * W)
l = vgg.feature_layer # feature layer of vgg (3 * 244 * 244 -> 14 * 14 * 512)
f = l(images) # out of memory!!!!

Batch size (2000) seems to big, so I modified like
f = tr.cat([ l(im) for im in images.split(10)]) # now batch size is 10, still out of memory!!!

I reduced the batch size like above, But still out of memory issue occurs.
How can I avoid it ???
My friend told me to use DataSet and DataLoader.
But I want to find a simple way