yun-liu / FastSaliency

Code for "SAMNet: Stereoscopically Attentive Multi-scale Network for Lightweight Salient Object Detection" and "Lightweight Salient Object Detection via Hierarchical Visual Perception Learning"
Other
52 stars 17 forks source link

About the GPU Memory #3

Open dreamer121121 opened 3 years ago

dreamer121121 commented 3 years ago

how do you test the GPU Memory Usage?

yun-liu commented 3 years ago

@dreamer121121 Since different saliency methods may use different deep learning frameworks for implementation, for example, Caffe, PyTorch, and Tensorflow, it is difficult to measure the memory usage using a strictly same function like torch.cuda.memory_allocated() in PyTorch. Instead, we record the real memory usage returned by the command nvidia-smi during the inference of a saliency method. Hence, the memory usage in our paper contains both the memory of a network and the necessary memory cache for running this network (in different deep learning frameworks). We believe that this would be a fair comparison in this case.