import gc import torch del model gc.collect() torch.cuda.empty_cache() Last modification:February 13th, 2022 at 10:20 pm © 允许规范转载