enlite-ai / maze Goto Github PK
View Code? Open in Web Editor NEWMaze Applied Reinforcement Learning Framework
Home Page: https://maze-rl.readthedocs.io/
License: Other
Maze Applied Reinforcement Learning Framework
Home Page: https://maze-rl.readthedocs.io/
License: Other
I've just been trying out maze and tried out the step-by-step tutorial.
In Step 5 (5. Training the MazeEnv) the instructions are incomplete or wrong.
I was able to get it running in the end, but it took (us) quite some time. I'm not sure if this is a bug in maze or hydra, of if just some newer version of either library changes the behavior a little bit. But you should update the documentation such that it works out of the box for new users of the library.
The setup (under Ubuntu 2020.04):
>> mkdir maze5 && cd maze5
>> pyenv local 3.8.8
>> python -m venv .venv
>> source .venv/bin/activate
>> pip install maze-rl torch
>> pip list
Package Version
----------------------- -----------
hydra-core 1.1.0
hydra-nevergrad-sweeper 1.1.5
maze-rl 0.1.7
torch 1.9.0
...
Then just copy-pasted the files from the https://github.com/enlite-ai/maze-examples/tree/main/tutorial_maze_env/part03_maze_env repo and adjusted the _target
paths in the config yamls (e.g. from _target_: tutorial_maze_env.part03_maze_env.env.maze_env.maze_env_factory
to _target_: env.maze_env.maze_env_factory
).
Problem 1:
When you run the suggested training command, Hydra will just complain that it can't find the configuration files.
>> maze-run -cn conf_train env=tutorial_cutting_2d_basic wrappers=tutorial_cutting_2d_basic \
model=tutorial_cutting_2d_basic algorithm=ppo
In 'conf_train': Could not find 'model/tutorial_cutting_2d_basic'
Available options in 'model':
flatten_concat
flatten_concat_shared_embedding
pixel_obs
pixel_obs_rnn
rllib
vector_obs
vector_obs_rnn
Config search path:
provider=hydra, path=pkg://hydra.conf
provider=main, path=pkg://maze.conf
provider=schema, path=structured://
Fix:
You can just define the config directory for hydra with maze-run -cd conf -cn conf_train ...
. Then Hydra will find the 3 config files and load them correctly.
Problem 2:
After loading the config files, hydra tries to load the modules defined in the _target
fields.
And that fails immediatly with:
...
File "***/maze5-uWAZh5bh/lib/python3.8/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 104, in _resolve_target
return _locate(target)
File "***/maze5-uWAZh5bh/lib/python3.8/site-packages/hydra/_internal/utils.py", line 563, in _locate
raise ImportError(f"Error loading module '{path}'") from e
ImportError: Error loading module 'env.maze_env.maze_env_factory'
Fix:
For some reason Hydra doesn't know the path to the directory from where we call maze-run
.
And therefore it doesn't find the env
directory containing the maze_env
file.
This is fixable by just setting the environment variable: export PYTHONPATH="$PYTHONPATH:$PWD/"
.
Thanks for using Hydra!
I see that you are using Hydra 1.1 already which is great. One thing that is really recent is the ability to configure the config searchpath from the primary config.
You can learn about it here.
This can probably eliminate the need of your users to even know what a ConfigSearchpathPlugin is.
Feel free to jump into the Hydra chat if you have any questions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.