I have noticed that in the introduction of your paper, it is said that iDIH will cost more than 20GB memory when harmonize a 2048*2048 image. However, in our test, it seems it cost only about 2.5GB. We conduct the test as follows:
with torch.no_grad():
input_tmp = torch.randn(1, 3, 2048, 2048).cuda()
mask_tmp = torch.randn(1, 1, 2048, 2048).cuda()
start = torch.cuda.memory_allocated() / 1024 / 1024
self.output = self.net(input_tmp,mask_tmp)
end_max = torch.cuda.max_memory_allocated() / 1024 / 1024
print("Max_memory:", (end_max-start))
Is there any wrong above? And I found that if I enable the grad, then the memory cost is about 20GB. So should I test that without the codeline "with torch.no_grad()" ?
Looking forward to your reply, many thanks.