CentOS下PyTorch內存管理可從釋放內存、降低消耗、優化配置等方面入手,具體如下:
torch.cuda.empty_cache()
del
torch.cuda.amp
float16
float32
torch.no_grad()
vm.swappiness
torch.cuda.memory_summary()