# Stable Baslines3: step vs global\_step vs tensorboard step

**URL:** <https://community.wandb.ai/t/stable-baslines3-step-vs-global-step-vs-tensorboard-step/4178>\
**Category:** W&B Help\
**Tags:** wandb, beginner-friendly\
**Created:** [April 4, 2023, 7:00am UTC](https://community.wandb.ai/t/stable-baslines3-step-vs-global-step-vs-tensorboard-step/4178 "2023-04-04T07:00:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![erikk](https://avatars.discourse-cdn.com/v4/letter/e/e47774/32.png) [@erikk](https://community.wandb.ai/u/erikk)\
**Post date:** [April 4, 2023, 7:00am UTC](https://community.wandb.ai/t/stable-baslines3-step-vs-global-step-vs-tensorboard-step/4178/1 "2023-04-04T07:00:08Z")

</div>

Hello Community,

I have a very basic question regarding the stable baseline3 integration.  
I want to plot basic stuff like the average episode reward. However, I am confused by the terms step and global\_step. What is the difference between them?  
When plotting global\_step over step I was expecting a straight line, but it turns out there is no linear relationship between those two values.  
Could someone explain to me the increment-rules of step and global\_step?

Also, when looking at the tensor board plots from within the WandB dashboard, I can see that the number of steps tensor board uses as x-axis differs to both global\_step and step used in the wandb plots. Something is very weird.

Thanks

---

<div class="post-metadata">

**Author:** ![mohammadbakir](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@mohammadbakir](https://community.wandb.ai/u/mohammadbakir)\
**Post date:** [April 6, 2023, 7:25pm UTC](https://community.wandb.ai/t/stable-baslines3-step-vs-global-step-vs-tensorboard-step/4178/2 "2023-04-06T19:25:39Z")

</div>

Hi @erikk , happy to help. At a high level the RL trainers maintain track of how many steps have been taken during the training when **batches** are processed during training. During training, the `global_step` is updated every time a batch is processed. When logging training metrics to wandb, the `global_step` is used as the x-axis to indicate this. The wandb sdk also has an internal step counter which follows a different rule for increments. Hence, both the trainer global step and wandb step variables are updated at different times due to the update conditions being different.

In regards to the Tensor Board behavior you are seeing, could you provide me a link to your workspace for review, or screenshots of what you are seeing. This will help me better understand what you are seeing.

---

<div class="post-metadata">

**Author:** ![mohammadbakir](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@mohammadbakir](https://community.wandb.ai/u/mohammadbakir)\
**Post date:** [April 11, 2023, 10:26pm UTC](https://community.wandb.ai/t/stable-baslines3-step-vs-global-step-vs-tensorboard-step/4178/3 "2023-04-11T22:26:51Z")

</div>

Hi @erikk since we have not heard back from you we are going to close this request. If you would like to re-open the conversation, please let us know!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/366b649231631dbab896843020da0056074ac79d.png) [@system](https://community.wandb.ai/u/system)\
**Post date:** [June 10, 2023, 10:27pm UTC](https://community.wandb.ai/t/stable-baslines3-step-vs-global-step-vs-tensorboard-step/4178/4 "2023-06-10T22:27:26Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
