def test_without_gui(clazz, model, rank, args): barrier = args print("rank %d os.pid=%d" % (rank, os.getpid())) env = clazz() env.set_model(model) env.set_rank(rank) if rank == 0: v = visualizer.Visualizer(DoubleA3CPPOEnv) v.env = env v.env.canvas = v.canvas v.visualize() gen = env.run(True) gen.send(None) while True: try: gen.send((None, )) except StopIteration: #barrier.wait() torch.save(env.a3c_model.state_dict(), "./tmp/model_%d_%d" % (env.game_no, os.getpid())) #barrier.wait() gen = env.run(True) gen.send(None)
def test(): v = visualizer.Visualizer(A3CSpliterEnv) v.visualize()
def test(): v = visualizer.Visualizer(DefaultGameEnv) v.visualize()
def test(): v = visualizer.Visualizer(ParallelA3CPPOEnv) v.visualize()
def test(): v = visualizer.Visualizer(DoubleA3CPPOEnv) v.visualize()
def test(): v = visualizer.Visualizer(A3CEnv) v.visualize()
def test(model): v = visualizer.Visualizer(ParallelA3CPPOEnv) v.env.set_model(model) v.visualize()
def test(): v = visualizer.Visualizer() v.visualize()