-
Notifications
You must be signed in to change notification settings - Fork 2
/
robot_test.py
33 lines (23 loc) · 962 Bytes
/
robot_test.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
30
31
32
import yaml
import argparse
from robot_move import MoveRobot
if __name__ == "__main__":
""" Code for testing trained TWR agent """
parser = argparse.ArgumentParser('robot Test', add_help=False)
# model config
parser.add_argument("--config-file",
default="./configs/spider.yaml",
metavar="FILE", help="path to config file")
parser.add_argument("--gpu", type=str, default="0", help="GPU id")
args = parser.parse_args()
model_config_path = args.config_file
# reads model config
with open(model_config_path, 'r') as f:
model_config = yaml.safe_load(f)
model_config['config_path'] = model_config_path
model_config['gpu_id'] = args.gpu
model_config['mode'] = 'test'
print(f'\n ===== Config File Path given: {model_config_path} =====\n')
print(yaml.dump(model_config, sort_keys=False))
robot_trainer = MoveRobot(model_config,)
robot_trainer.run()