Commit 3967fb57 by Werner Duvaud

Change default keyboardInterupt behavior

parent ea88b0ed
...@@ -135,6 +135,8 @@ class MuZero: ...@@ -135,6 +135,8 @@ class MuZero:
counter += 1 counter += 1
time.sleep(3) time.sleep(3)
except KeyboardInterrupt: except KeyboardInterrupt:
# Comment the line below to be able to stop the training but keep running
raise KeyboardInterrupt
pass pass
self.muzero_weights = ray.get(shared_storage_worker.get_weights.remote()) self.muzero_weights = ray.get(shared_storage_worker.get_weights.remote())
ray.shutdown() ray.shutdown()
...@@ -143,7 +145,7 @@ class MuZero: ...@@ -143,7 +145,7 @@ class MuZero:
""" """
Test the model in a dedicated thread. Test the model in a dedicated thread.
""" """
print("Testing...") print("\nTesting...")
ray.init() ray.init()
self_play_workers = self_play.SelfPlay.remote( self_play_workers = self_play.SelfPlay.remote(
copy.deepcopy(self.muzero_weights), self.Game(), self.config copy.deepcopy(self.muzero_weights), self.Game(), self.config
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment