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

Error when using recommended plotting commands #387

Open
1 task done
ikamensh opened this issue Jun 22, 2023 · 3 comments
Open
1 task done

Error when using recommended plotting commands #387

ikamensh opened this issue Jun 22, 2023 · 3 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Help from contributors is needed

Comments

@ikamensh
Copy link

ikamensh commented Jun 22, 2023

πŸ“š Documentation

I'm following instructions in https://stable-baselines3.readthedocs.io/en/master/modules/sac.html#how-to-replicate-the-results and get following error:

(sb3zoo) ~/o/rl-baselines3-zoo (master|✚2) [1] $ python scripts/plot_from_file.py -i logs/sac_results.pkl -latex -l SAC
# results_table
|Environments|    SAC    |
|------------|-----------|
|            |logs/      |
|HalfCheetah |9440 +/- 35|
|Ant         |0.0 +/- 0.0|
|Hopper      |0.0 +/- 0.0|
|Walker2D    |0.0 +/- 0.0|
keys: ['SAC-logs/']
2023-06-22 11:19:28.126 Python[74358:31690315] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/_p/sbw9kb5d3x1cv5jslnvbp6lm0000gp/T/org.python.python.savedState
Traceback (most recent call last):
  File "/Users/kai7rng/oss/rl-baselines3-zoo/scripts/plot_from_file.py", line 4, in <module>
    plot_from_file()
  File "/Users/kai7rng/oss/rl-baselines3-zoo/rl_zoo3/plots/plot_from_file.py", line 135, in plot_from_file
    timesteps = results[env][key]["timesteps"]
                ~~~~~~~~~~~~^^^^^
KeyError: 'SAC-logs/'

This might be because I copied previous command python scripts/all_plots.py -a sac -e HalfCheetah Ant Hopper Walker2D -f logs/ -o logs/sac_results and didn't remove environments I didn't run (e.g. Ant). Still error message could be more clear, or better empty folders could be skipped.

Thanks! :)

Checklist

  • I have checked that there is no similar issue in the repo
@ikamensh ikamensh added the documentation Improvements or additions to documentation label Jun 22, 2023
@araffin
Copy link
Member

araffin commented Jun 22, 2023

Hello,

didn't remove environments I didn't run (e.g. Ant). Still error message could be more clear, or better empty folders could be skipped.

yes, that's probably the case, you should be able to re-run the previous command with only the correct env (it will overwrite the pkl file).

Still error message could be more clear, or better empty folders could be skipped.

I also agree and would welcome a PR that closes this issue =)

@araffin araffin added enhancement New feature or request help wanted Help from contributors is needed labels Jun 22, 2023
@corentinlger
Copy link

Hi, can I try to solve this ? Or someone is already doing it ?

@araffin
Copy link
Member

araffin commented Sep 28, 2023

Hi, can I try to solve this ?

yes you can =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Help from contributors is needed
Projects
None yet
Development

No branches or pull requests

3 participants