Skip to content

Commit

Permalink
Merge pull request #140 from Isalia20/proper_gpu_memory_release
Browse files Browse the repository at this point in the history
Proper gpu memory release
  • Loading branch information
nadermx committed Apr 19, 2024
2 parents c590858 + dfa4dd8 commit 22596ef
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions backgroundremover/u2net/detect.py
Expand Up @@ -151,5 +151,6 @@ def predict(net, item):
img = Image.fromarray(predict_np * 255).convert("RGB")

del d1, d2, d3, d4, d5, d6, d7, pred, predict, predict_np, inputs_test, sample
torch.cuda.empty_cache() if torch.cuda.is_available() else None

return img

0 comments on commit 22596ef

Please sign in to comment.