CentOS下PyTorch内存管理可从释放内存、降低消耗、优化配置等方面入手,具体如下:
torch.cuda.empty_cache()
del
torch.cuda.amp
float16
float32
batch_size
torch.no_grad()
vm.swappiness
torch.cuda.memory_summary()