Fixes Memory Leak

pull/22/head
TingTingin 2022-12-06 19:20:42 -04:00 committed by GitHub
parent b7b7321b67
commit bfcd6f647e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -1,11 +1,11 @@
import torch
import torch, gc
import cv2
import requests
import os.path
import contextlib
from PIL import Image
from modules.shared import opts, cmd_opts
from modules import processing, images, shared
from modules import processing, images, shared, devices
from torchvision.transforms import Compose
from repositories.midas.midas.dpt_depth import DPTDepthModel
@ -167,3 +167,5 @@ class SimpleDepthMapGenerator(object):
raise
finally:
del model
gc.collect()
devices.torch_gc()