IntelLabs / coach

Reinforcement Learning Coach by Intel AI Lab enables easy experimentation with state of the art Reinforcement Learning algorithms
https://intellabs.github.io/coach/
Apache License 2.0
2.32k stars 460 forks source link

Presets not found #474

Open ShrutiKaha opened 3 years ago

ShrutiKaha commented 3 years ago

coach -l shows the list of available presets. But when I try to run any of the examples presets, a not found error is thrown.

For example, (base) C:\Users\shrut>coach -p Atari_DQN -lvl breakout ←[91mThe given preset (C:\Users\shrut\AppData\Roaming\Python\Python38\site-packages\rl_coach\presets\Atari_DQN.py:graph_manager) cannot be found.←[0m

Also tried using the complete path to the preset, doesn't help.

rajivranjansinghpolice commented 1 year ago

I am also facing the same issue. Would be glad to get a response.

rajivranjansinghpolice commented 1 year ago

I found the issue. This needs a commit to the coach.py file.

if not os.path.exists(preset_path): needs to be changed to if not _os.path.exists(preset_path.encode('unicode_escape')):

Issue can be reproduced as below:-

preset_path = "C:\ProgramData\mambaforge\envs\rl\Lib\site-packages\rl_coach\presets\CartPole_ClippedPPO.py"
os.path.exists(preset_path)

returns False

os.path.abspath(preset_path) returns 'C:\ProgramData\mambaforge\envs\rl\Lib\site-packages\rl_coach\presets\CartPole_ClippedPPO.py'

This is because \r is beingparsed as carriage return leading to the error.

os.path.exists(preset_path.encode('unicode_escape')) returns True

rajivranjansinghpolice commented 1 year ago

further update. the whole expand_preset function is problematic.concatenating ":graph_manager" string to preset needs to be reviewed.