Add destructor to torch_neural_net for #194

This commit is contained in:
Brandon Amos 2016-10-21 07:47:42 -04:00
parent 4d0280557c
commit 0b6b22313e
1 changed files with 4 additions and 0 deletions

View File

@ -68,6 +68,10 @@ class TorchNeuralNet:
self.p.kill() self.p.kill()
atexit.register(exitHandler) atexit.register(exitHandler)
def __del__(self):
if self.p.poll() is None:
self.p.kill()
def forwardPath(self, imgPath): def forwardPath(self, imgPath):
""" """
Perform a forward network pass of an image on disk. Perform a forward network pass of an image on disk.