hardmaru / slimevolleygym Goto Github PK
View Code? Open in Web Editor NEWA simple OpenAI Gym environment for single and multi-agent reinforcement learning
License: Apache License 2.0
A simple OpenAI Gym environment for single and multi-agent reinforcement learning
License: Apache License 2.0
when you run this code:
# tests/test_envs.py
import gym
SLIME_VOLLEY_NAMES = ['SlimeVolley-v0','SlimeVolleyPixel-v0','SlimeVolleyNoFrameskip-v0']
def check_env(name):
print('check env', name)
env = gym.make(name)
o = env.reset()
o,r,d,i = env.step(env.action_space.sample())
try:
env.render()
except Exception as e:
print(name, 'doesnt implement render <-----')
env.close()
try:
env.render(close=True)
except Exception as e:
print(name, 'doesnt support close=True <-----')
print(e)
def test_envs():
[check_env(name) for name in SLIME_VOLLEY_NAMES]
pytest -s tests/test_envs.py
the windows don't seem to close when we call env.close -- they stay open until the whole script is done.
How do you close the render window, or is this test code screwed up?
First of all, thank you so much for sharing the nice env and the baselines! I'm happy to see that ChainerRL is chosen for the Rainbow baseline.
Regarding the issue described in the title, please look at the attached animation.
I'm not sure if the issue needs to be fixed because it rarely happens (at least in my experiences so far with this env). However, it could possibly be exploited by some clever agent. That agent would be undefeatable.
Hello David,
Very nice project =)! I'm glab that you chose Stable Baselines for the RL part.
We would be also interested if you could do a pull request on stable-baselines where you add your project to the documentation (project section) ;)
This will help people when they want to solve similar environments (e.g. self-play) and also give additional visibility to your repo ;)
Cool environment! Based on one of my favs, https://g.co/kgs/c9USnV
Seems the project require opencv-python-4.2.0.34 added to setup.py?
python test_state.py
Traceback (most recent call last):
File "test_state.py", line 10, in <module>
import slimevolleygym
File "D:\projects\python\slimevolleygym\slimevolleygym\__init__.py", line 1, in <module>
import slimevolleygym.slimevolley
File "D:\projects\python\slimevolleygym\slimevolleygym\slimevolley.py", line 22, in <module>
import cv2 # installed with gym anyways
ModuleNotFoundError: No module named 'cv2'
ERROR: Could not find a version that satisfies the requirement cv2 (from versions: none)
ERROR: No matching distribution found for cv2
Should the number of bounces on one side be limited? Currently a simple controller can hold a ball forever.
https://github.com/slitvinov/slimevolleygym/blob/master/figure/README.md
For anyone experiencing the following error on Mac, Big Sur:
ImportError: Can't find framework /System/Library/Frameworks/OpenGL.framework.
this fix worked for me:
I don't know if i'm doing something wrong, I load the env and then use the wrapper AtariPreprocessing
env = gym.make("SlimeVolleyNoFrameskip-v0")
env = AtariPreprocessing(env)
But when running it gives out this error:
self.env.unwrapped.np_random.randint(1, self.noop_max + 1)
'SlimeVolleyAtariEnv' object has no attribute 'np_random'
It works when running a normal atari environment like "PongNoFrameskip-v0"
Hi, would it be possible for slime volley gym to be upgraded from gym to gymnasium? Gymnasium is the maintained version of openai gym and is compatible with current RL training libraries (rllib and tianshou have already migrated, and stable-baselines3 will soon).
This is currently listed in the gymnasium third party environments but we are cleaning the list up to only include maintained gymnasium-compatible repositories.
For information about upgrading and compatibility, see migration guide and gym compatibility.
Hi,
Is there any way to use SLM lab for this environment?
Hi,
Thank you so much for this beautiful environment and all the well-trained models!
May I ask a question when trying to run python eval_agents.py --left ppo --right cma --render
where I got the error
Traceback (most recent call last):
File "eval_agents.py", line 174, in
render_mode=render_mode, n_trials=args.trials, init_seed=args.seed)
File "eval_agents.py", line 93, in evaluate_multiagent
cumulative_score = rollout(env, policy0, policy1, render_mode=render_mode)
File "eval_agents.py", line 72, in rollout
obs0, reward, done, info = env.step(action0, action1)
TypeError: step() takes 2 positional arguments but 3 were given
Could you please give me some advice on it? Thanks!
Hello.
I have a question.
In slimevolleygym/training_scripts/train_ppo_pixel.py it says NUM_TIMESTEPS = 2000000000.
Did you actually do 2000000000timesteps?
How many timesteps did you get for best_model?
Also, how long did it take you to get the best_model?
If possible, please let me know the experimental environment.
Was having difficulties getting the code to run with the given dependencies.
I downgraded my Python to 3.8.18 and changed Pyglet to 1.5.28 rather than the 1.5.11 in the requirements.txt.
I additionally downgraded pip and setuptools so that gym==0.19.0 could be installed as newer versions cannot be used. I used: pip install setuptools==65.5.0 pip==21
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.