Flush out print text so I can keep track of the rewards by SSHing in

This commit is contained in:
Brandon Rozek 2019-09-13 19:48:51 -04:00
parent 912e3d42cb
commit dcf7cce30d

View file

@ -17,7 +17,7 @@ def simulateEnvEps(env, actor, config, total_episodes = 1, memory = None, logger
if episode % config['print_stat_n_eps'] == 0:
print("episode: {}/{}, score: {}"
.format(episode, total_episodes, episode_reward))
.format(episode, total_episodes, episode_reward), flush=True)
if logger is not None:
logger.append(name + '/EpisodeReward', episode_reward)
@ -51,7 +51,7 @@ class EnvironmentRunSync():
if done:
if self.episode_num % self.config['print_stat_n_eps'] == 0:
print("episode: {}/{}, score: {}"
.format(self.episode_num, self.config['total_training_episodes'], self.episode_reward))
.format(self.episode_num, self.config['total_training_episodes'], self.episode_reward), flush=True)
if self.logwriter is not None:
logger.append(self.name + '/EpisodeReward', self.episode_reward)
@ -92,10 +92,10 @@ class EnvironmentEpisodeSync():
if self.episode_num % self.config['print_stat_n_eps'] == 0:
print("episode: {}/{}, score: {}"
.format(self.episode_num, self.config['total_training_episodes'], episodeReward))
.format(self.episode_num, self.config['total_training_episodes'], episodeReward), flush=True)
if self.logwriter is not None:
logger.append(self.name + '/EpisodeReward', episodeReward)
self.logwriter.write(logger)
self.episode_num += 1
self.episode_num += 1