Skip to content

Commit

Permalink
Fix step used to log SAC summary
Browse files Browse the repository at this point in the history
  • Loading branch information
krishpop authored Sep 19, 2020
1 parent 3d115a3 commit 0e79512
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stable_baselines/sac/sac.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ def setup_model(self):
self.summary = tf.summary.merge_all()

def _train_step(self, step, writer, learning_rate):
del step
# Sample a batch from the replay buffer
batch = self.replay_buffer.sample(self.batch_size, env=self._vec_normalize_env)
batch_obs, batch_actions, batch_rewards, batch_next_obs, batch_dones = batch
Expand All @@ -336,7 +337,7 @@ def _train_step(self, step, writer, learning_rate):
if writer is not None:
out = self.sess.run([self.summary] + self.step_ops, feed_dict)
summary = out.pop(0)
writer.add_summary(summary, step)
writer.add_summary(summary, self.num_timesteps)
else:
out = self.sess.run(self.step_ops, feed_dict)

Expand Down

0 comments on commit 0e79512

Please sign in to comment.