-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patheval.py
More file actions
26 lines (16 loc) · 661 Bytes
/
eval.py
File metadata and controls
26 lines (16 loc) · 661 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
import hydra
import utils
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
@hydra.main(version_base="1.2", config_path="./config", config_name="train")
def main(cfg):
utils.set_seed_everywhere(cfg.seed)
agents = [utils.make_agent(cfg)]
assert cfg.alg.name == "smiling", "Please turn on the smiling algorithm"
agent_model_paths = utils.get_agent_model_paths(cfg)
for agent, path in zip(agents, agent_model_paths):
agent.load_agent(path)
avg_episode_return = agents[0].evaluate("EVAL")
print(f"avg episode return: {avg_episode_return}", flush=True)
if __name__ == "__main__":
main()