-
Notifications
You must be signed in to change notification settings - Fork 103
/
demo.py
29 lines (24 loc) · 1.04 KB
/
demo.py
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
import argparse
from xuance import get_runner
def parse_args():
parser = argparse.ArgumentParser("Run a demo.")
parser.add_argument("--method", type=str, default="dqn")
parser.add_argument("--env", type=str, default="classic_control")
parser.add_argument("--env-id", type=str, default="CartPole-v1")
parser.add_argument("--test", type=int, default=0)
parser.add_argument("--device", type=str, default="cuda:0")
return parser.parse_args()
if __name__ == '__main__':
parser = parse_args()
########################################################################
# You can also modify the arguments not listed above here. For example:
# parser.parallels = 1
# parser.running_steps = 1000000
# ...
########################################################################
runner = get_runner(method=parser.method,
env=parser.env,
env_id=parser.env_id,
parser_args=parser,
is_test=parser.test)
runner.run()