Open TimZhang001 opened 2 years ago
I believe it's a matter of GPU's memory.
The whole process is equal to:
dist_matrix = torch.pairwise_distance(feat_gallery, test_feat_map)
However, if you want to compute it all at once, pytorch will allocate a huge number of GPU's memory (layer1 requires nearly 45GB per test sample).
Calculating them separately (e.g. 100 pixels at a time) can reduce the usage of memory.
calculate distance matrix
I don't know the meaning of parameter of 100. it will compare the tensors of 100-256-1-1 and 1-256-64-64