From 1bc2d38e685ba249e4b126f4e3911f65dc03aa31 Mon Sep 17 00:00:00 2001 From: sykwer Date: Wed, 27 Feb 2019 20:35:33 +0900 Subject: [PATCH] Add workaround for three unsupported agents --- chainerrl_visualizer/launcher.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/chainerrl_visualizer/launcher.py b/chainerrl_visualizer/launcher.py index cec6b9d..eebf17d 100644 --- a/chainerrl_visualizer/launcher.py +++ b/chainerrl_visualizer/launcher.py @@ -110,6 +110,13 @@ def inspect_agent(agent, gymlike_env, contains_rnn): model = agent.model obs = gymlike_env.reset() + # workaround + # The author of this library (@sykwer) assumed that all agents have a `model` attribute and + # `model.__call__()` returns outputs of the model. However, DDPG, PGT and TRPO are exceptions + # for the assumption. This issue will be fixed soon. + if type(agent).__name__ in ['DDPG', 'PGT', 'TRPO']: + raise Exception('Agent type of {} is not supported for now'.format(type(agent).__name__)) + # workaround if hasattr(agent, 'xp'): xp = agent.xp