Update my_model/utilities.py
Browse files- my_model/utilities.py +2 -2
my_model/utilities.py
CHANGED
@@ -296,8 +296,8 @@ def free_gpu_resources():
|
|
296 |
"""
|
297 |
Clears GPU memory.
|
298 |
"""
|
299 |
-
|
300 |
-
|
301 |
torch.cuda.empty_cache()
|
302 |
torch.cuda.empty_cache()
|
303 |
gc.collect()
|
|
|
296 |
"""
|
297 |
Clears GPU memory.
|
298 |
"""
|
299 |
+
|
300 |
+
if torch.cuda.is_available():
|
301 |
torch.cuda.empty_cache()
|
302 |
torch.cuda.empty_cache()
|
303 |
gc.collect()
|