How to display training results with stable-baselines3
See original GitHub issueHi all,
I have defined an agent and I would like to see the training results. For that I use the following code (with a custom environment):
from stable_baselines3 import A2C
import os
env = DSM_BT1_Env()
models_dir = "models/A2C"
logdir = "logs"
timesteps = 1000
if not os.path.exists(models_dir):
os.makedirs(models_dir)
if not os.path.exists(logdir):
os.makedirs(logdir)
model = A2C('MlpPolicy', env, verbose=1, tensorboard_log=logdir)
timesteps = 1000
for i in range (1, 5):
model.learn(total_timesteps=timesteps, reset_num_timesteps=False, tb_log_name = "A2C")
model.save(f"{models_dir}/{timesteps*i} ")
So I log the data in a folder called log which is created during training and in that folder a subfolder with the name A2C_0 is created that contains a lot of files. Now I tried to visualize it the same way as it is done in a tutorial (https://www.youtube.com/watch?v=dLP-2Y6yu70) . For that I tried to open Tensorboard with the following command line:
#tensorboard --logdir=logdir --host localhost --port 8088
Altough I can open Tensorboard, no related training results are displayed. I also tried other commands like:
tensorboard --logdir="C:/Users/Desktop/Python/Stable_Baselines3/logs" --host localhost --port 8088
but that led to the same result.
Now my question is, how can I display the training results of stable-baselines3 agents? It does not necessarily have to be with Tensorboard. I just want to display the logged data for the training (this could be for example also done with matplotlib). Do you have any idea how I can do that?
Issue Analytics
- State:
- Created 2 years ago
- Comments:10
Top GitHub Comments
Okay. Thanks Miffyli for your advice.
Hmm right. I’d recommend trying to copy projects that use tensorboard and see how they work (e.g. see how stable-baselines3 zoo uses tensorboard, and try running some codes to verify it still works).
I am closing this as resolved. If you find a bug which prevents tensorboard working, please open up a new issue 😃