Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.

Workaround for DDPG, PGT and TRPO #9

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions chainerrl_visualizer/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down