diff --git a/src/parallel/client.py b/src/parallel/client.py index f506f0a..5a2de38 100644 --- a/src/parallel/client.py +++ b/src/parallel/client.py @@ -136,7 +136,10 @@ def __main__(): download_network() # train_shared s'appelle récursivement sur lui même jusqu'à la fin du programme - train_shared(dataset, start, nb_elem, epochs=1, out=DELTA) + try: + train_shared(dataset, start, nb_elem, epochs=1, out=DELTA) + except requests.exceptions.ConnectionError: + print("Host disconnected") if __name__ == "__main__": diff --git a/src/parallel/structures.py b/src/parallel/structures.py index 2f3b18d..33cc2fd 100644 --- a/src/parallel/structures.py +++ b/src/parallel/structures.py @@ -3,7 +3,6 @@ Description des structures. """ import os -import sys import time import subprocess @@ -104,7 +103,7 @@ class Training: self.cur_image = 0 if self.cur_batch >= self.batchs: print("Done.") - sys.exit() + os._exit(0) def patch(self): @@ -118,7 +117,7 @@ class Training: with open(self.reseau + ".lock", "w", encoding="utf8") as file: file.write("") - if not os.path.isfile("out/main"): + if not os.path.isfile("out/utils"): subprocess.call(["./make.sh", "build", "utils"]) subprocess.call( [