Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wandb does not seem to record time or step correctly #208

Open
DanielTakeshi opened this issue Oct 27, 2022 · 3 comments
Open

Wandb does not seem to record time or step correctly #208

DanielTakeshi opened this issue Oct 27, 2022 · 3 comments

Comments

@DanielTakeshi
Copy link

DanielTakeshi commented Oct 27, 2022

I am running PPO with wandb integration, but the statistics seem to not be recorded as intended.

I am testing this with Isaac Gym environments but I am unsure if this issue is specific to Isaac Gym.

Steps to reproduce: after installing following the IsaacGymEnvs instructions, run a command like this in the isaacgymenvs/ directory:

python train.py task=Ant headless=True wandb_activate=True wandb_entity=danieltakeshi wandb_project=isaac-gym

Where you can replace danieltakeshi with your username, and change isaac-gym to your project.

After I run this, the reward goes up (good) but I also see this on wandb:

Screenshot from 2022-10-27 13-23-04

The code is recording the reward as a function of iter, step, and time. It stores it in rl_games here:

for i in range(self.value_size):
rewards_name = 'rewards' if i == 0 else 'rewards{0}'.format(i)
self.writer.add_scalar(rewards_name + '/step'.format(i), mean_rewards[i], frame)
self.writer.add_scalar(rewards_name + '/iter'.format(i), mean_rewards[i], epoch_num)
self.writer.add_scalar(rewards_name + '/time'.format(i), mean_rewards[i], total_time)
self.writer.add_scalar('episode_lengths/step', mean_lengths, frame)
self.writer.add_scalar('episode_lengths/iter', mean_lengths, epoch_num)
self.writer.add_scalar('episode_lengths/time', mean_lengths, total_time)

The code is storing the statistics with respect to different quantities (epoch, step, and time) to the self.writer which is a tensorboardX.SummaryWriter (link to docs). But the statistics on wandb seem to only show the x-axis as "iter" (which is the same as epoch_num here) and they don't show performance as a function of the step or time. Is there a way to address such an issue here?

(Also posting on the Isaac Gym repo isaac-sim/IsaacGymEnvs#87)

@Denys88
Copy link
Owner

Denys88 commented Nov 28, 2022

@DanielTakeshi I am sorry I missed your issue.
@vwxyzjn could you take a look if you have free time?

@vwxyzjn
Copy link
Contributor

vwxyzjn commented Nov 28, 2022

try changing the x axis to global_step on the top right (there is a button)

@DanielTakeshi
Copy link
Author

Sorry for my delayed repsonse as well, @Denys88 and @vwxyzjn.

It looks like we can adjust the x-values here:

Screen Shot 2022-12-28 at 10 40 53 AM

So I think the intended usage here is that we are supposed to adjust rewards/time so that the x-axis has Wall Time and rewards/step so that it uses global_step? (Somewhat confusingly, rewards/iter seems fine with the normal Step though it is clear in the code that iter is supposed to refer to an epoch.)

Screen Shot 2022-12-28 at 10 42 04 AM

It would be nice if there was a way to automatically set all three plots so that they use the appropriate x-axis at the start. I'm not sure if this function is available.

If this is the intended usage, feel free to close this issue report. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants