-
Notifications
You must be signed in to change notification settings - Fork 92
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 while running tutrials files #122
Comments
Here is the code that I try to run: """
Short introduction to running the Overcooked environment and visualising it using random actions.
"""
import jax
from jaxmarl import make
from jaxmarl.viz.overcooked_visualizer import OvercookedVisualizer
from jaxmarl.environments.overcooked import Overcooked, overcooked_layouts, layout_grid_to_dict
import time
# Parameters + random keys
max_steps = 100
key = jax.random.PRNGKey(0)
key, key_r, key_a = jax.random.split(key, 3)
# Get one of the classic layouts (cramped_room, asymm_advantages, coord_ring, forced_coord, counter_circuit)
layout = overcooked_layouts["cramped_room"]
# Or make your own!
# custom_layout_grid = """
# WWOWW
# WA W
# B P X
# W AW
# WWOWW
# """
# layout = layout_grid_to_dict(custom_layout_grid)
# Instantiate environment
env = make('overcooked', layout=layout, max_steps=max_steps)
obs, state = env.reset(key_r)
print('list of agents in environment', env.agents)
# Sample random actions
key_a = jax.random.split(key_a, env.num_agents)
actions = {agent: env.action_space(agent).sample(key_a[i]) for i, agent in enumerate(env.agents)}
print('example action dict', actions)
state_seq = []
for _ in range(max_steps):
state_seq.append(state)
# Iterate random keys and sample actions
key, key_s, key_a = jax.random.split(key, 3)
key_a = jax.random.split(key_a, env.num_agents)
actions = {agent: env.action_space(agent).sample(key_a[i]) for i, agent in enumerate(env.agents)}
# Step environment
obs, state, rewards, dones, infos = env.step(key_s, state, actions)
viz = OvercookedVisualizer()
# Render to screen
for s in state_seq:
viz.render(env.agent_view_size, s, highlight=False)
time.sleep(0.25)
# # Or save an animation
# viz.animate(state_seq, agent_view_size=5, filename='animation.gif') |
The same thing happens in your collab page (https://colab.research.google.com/github/FLAIROx/JaxMARL/blob/main/jaxmarl/tutorials/JaxMARL_Walkthrough.ipynb#scrollTo=h3VkMmsdPfc0) so the problem is not on my computer. |
Yep I can confirm that I got the same error: |
OMG, the |
Hey! Thanks for posting this and apologies for our late reply, we’ll get on fixing this :) |
fixed with #123 |
Try to run tutorials files, here is the error I get:
What can be an issue?
The text was updated successfully, but these errors were encountered: