当前位置:主页 > 软件编程 > Python代码 >
时间:2021-03-08 11:41:03 | 栏目:Python代码 | 点击:次
1-删除模型变量
del model_define
2-清空CUDA cache
torch.cuda.empty_cache()
3-步骤2(异步)需要一定时间,设置时延
time.sleep(5)
完整代码如下:
del styler torch.cuda.empty_cache() time.sleep(5)