question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Newline problem of Monitor's ResultsWriter in Windows environments

See original GitHub issue

https://github.com/DLR-RM/stable-baselines3/blob/e24147390d2ce3b39cafc954e079d693a1971330/stable_baselines3/common/monitor.py#L181 When running the codes in Windows environments, the logged csv files end each line with \r\r\n, making empty lines between data lines. From Python 3 documentation, adding newline='' as an argument of the open function seems able to solve the problem. https://docs.python.org/3/library/csv.html#examples

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
Miffylicommented, Dec 16, 2021

means something like self.file_handler = open(filename, “wt”, newline=“\n”) instead of using newline=“”.

What I meant is that all lines end with only a single “\n”, so this (the quoted part) might do the trick unless rest of the code adds additional “\n” or other characters into the mix 😃.

1reaction
araffincommented, Dec 15, 2021

In such a case, I feel that MS Excel is more convenient, though this is just my experience.

I would disagree with that. Using tensorboard or simply python scripts/plot_train.py -a ppo -e Cartpole -f logs/ -w 100 from the RL Zoo are two convenient options. They also handle multi envs properly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

stable_baselines3.common.monitor - Stable Baselines3
Wrapper): """ A monitor wrapper for Gym environments, it is used to know the episode reward, length, time and other data. :param env:...
Read more >
Plotting Documentation #356 - DLR-RM/stable-baselines3
We need to document: plotting training reward/success (using monitor file) ... Newline problem of Monitor's ResultsWriter in Windows environments #692.
Read more >
Troubleshoot external monitor connections in Windows 10
Troubleshoot issues that occur when setting up external monitors. If you are trying to set up an external monitor and it's not working,...
Read more >
User Manual | Newline Interactive
windows, or outdoor environments that experience rain, snow, or other harsh weather. Avoid installation near hot spring vapor. The preceding environments ...
Read more >
How to setup touch extended mode in Windows
Issue: Touch screen is not functioning as expected when Windows computer is in extended mode · **For MacOS visit: Helpdesk : Newline Interactive ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found