I want to append features to a list.
but out of memory occurs.
Here is my codes.
for epoch in range(total_epochs): list_a =  for step, data in range(data_loader): ... if some_condition: list_a.append(features.cpu()) # (both cuda() and cpu() occurs memory out) data_loader_a = torchdata.DataLoader(list_a, ...) for step, data in range(data_loader_a): ... train process ...
How can I solve this problem?