-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrun_client.py
More file actions
33 lines (29 loc) · 755 Bytes
/
run_client.py
File metadata and controls
33 lines (29 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import os
os.environ["CUDA_VISIBLE_DEVICES"]=""
import random
random.seed(0)
import numpy as np
np.random.seed(0)
import torch
torch.manual_seed(0)
print("SET TORCH TO 1 THREAD IN RUN_CLIENT")
torch.set_num_threads(1)
from distrib_rl.policy_optimization.distrib_policy_gradients import Client
def main():
client = Client()
client.configure()
try:
client.train()
except:
import traceback
print("EXCEPTION OCCURRED IN CLIENT!")
print(traceback.format_exc())
finally:
try:
client.cleanup()
except:
import traceback
print("!!UNABLE TO CLEANUP CLIENT, SHUTDOWN FAILED!!")
print(traceback.format_exc())
if __name__ == "__main__":
main()