I want to combine several model predictions together to achieve a better result,
for cnt, (images, labels) in enumerate(data_loader):
images, labels = Variable(images), Variable(labels)
outputs = torch.exp(net.forward(images))
if counter == 1:
bmv.append(outputs)
else:
bmv[cnt] += outputs # the place the memory explodes
If I replace += with =, there is no problem. I don’t know the reason. Waiting for answers
Furthermore, it didn’t get better even I change outputs to int. The memory still explodes in the same iteration.