diff --git a/centml/compiler/backend.py b/centml/compiler/backend.py index 2ae4656..7ecd3ad 100644 --- a/centml/compiler/backend.py +++ b/centml/compiler/backend.py @@ -164,7 +164,8 @@ def remote_compilation(self): # Let garbage collector free the memory used by the uncompiled model with self.lock: del self.inputs - del self.module + if self.module: + del self.module gc.collect() torch.cuda.empty_cache()