Skip to content

Commit 73cf8e1

Browse files
committed
📢 Logging out-of-memory errors, they were suppressed.
1 parent 32c43d2 commit 73cf8e1

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/texturize/api.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
# texturize — Copyright (c) 2020, Novelty Factory KG. See LICENSE for details.
22

3-
import os
43
import math
54

65
import torch
7-
import torch.nn.functional as F
86
from creativeai.vision import encoders
97

10-
from .critics import GramMatrixCritic, PatchCritic, HistogramCritic
11-
from .app import TextureSynthesizer, Application, Result
8+
from .app import Application, Result
129
from .io import *
1310

1411

@@ -80,6 +77,8 @@ def process_iterations(
8077
except RuntimeError as e:
8178
if "CUDA out of memory." not in str(e):
8279
raise
80+
app.log.error(f"ERROR: Out of memory at octave {octave}.")
81+
app.log.debug(e)
8382

8483
import gc; gc.collect
8584
torch.cuda.empty_cache()

src/texturize/logger.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ def info(self, *args):
7070
def warn(self, *args):
7171
print(ansi.YELLOW + "".join(args) + ansi.ENDC)
7272

73+
def error(self, *args):
74+
print(ansi.PINK + "".join(args) + ansi.ENDC)
75+
7376

7477
class NotebookLog:
7578
class ProgressBar:

0 commit comments

Comments
 (0)