From 74788bcf96ce514ee41e4ad13b56f0c2e1a3e904 Mon Sep 17 00:00:00 2001 From: Mike C Date: Mon, 22 Jan 2018 10:48:40 +0800 Subject: [PATCH] deal with non scalar action --- agent/DDPG_agent.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/agent/DDPG_agent.py b/agent/DDPG_agent.py index 59ef543..be19e19 100644 --- a/agent/DDPG_agent.py +++ b/agent/DDPG_agent.py @@ -81,7 +81,10 @@ class DDPGAgent: # tensorboard logging suffix = 'test_' if deterministic else '' - config.logger.scalar_summary(suffix + 'action', action, self.total_steps) + if action.squeeze().ndim == 0: + config.logger.scalar_summary(suffix + 'action', action, self.total_steps) + else: + config.logger.histo_summary(suffix + 'action', action, self.total_steps) config.logger.scalar_summary(suffix + 'reward', reward, self.total_steps) for key in info: config.logger.scalar_summary('info_' + key, info[key], self.total_steps)