Closed Minusadd closed 1 year ago
Hi, thanks for reporting this. Are you using the latest version of avalon, and are you running it from this github repo or via pip install avalon-rl
?
I am able to reproduce this now, we recently required all scripts to call configure_local_logger
before initialization and forgot to update the quickstart code. The correct quickstart code should be the following:
from avalon.agent.godot.godot_gym import GodotEnvironmentParams
from avalon.agent.godot.godot_gym import TrainingProtocolChoice
from avalon.agent.godot.godot_gym import AvalonEnv
from avalon.common.log_utils import configure_local_logger
from avalon.datagen.env_helper import display_video
configure_local_logger()
env_params = GodotEnvironmentParams(
resolution=256,
training_protocol=TrainingProtocolChoice.SINGLE_TASK_FIGHT,
initial_difficulty=1,
)
env = AvalonEnv(env_params)
env.reset()
def random_env_step():
action = env.action_space.sample()
obs, reward, done, info = env.step(action)
if done:
env.reset()
return obs
observations = [random_env_step() for _ in range(50)]
display_video(observations, fps=10)
We will push a fix shortly.
I am able to reproduce this now, we recently required all scripts to call
configure_local_logger
before initialization and forgot to update the quickstart code. The correct quickstart code should be the following:from avalon.agent.godot.godot_gym import GodotEnvironmentParams from avalon.agent.godot.godot_gym import TrainingProtocolChoice from avalon.agent.godot.godot_gym import AvalonEnv from avalon.common.log_utils import configure_local_logger from avalon.datagen.env_helper import display_video configure_local_logger() env_params = GodotEnvironmentParams( resolution=256, training_protocol=TrainingProtocolChoice.SINGLE_TASK_FIGHT, initial_difficulty=1, ) env = AvalonEnv(env_params) env.reset() def random_env_step(): action = env.action_space.sample() obs, reward, done, info = env.step(action) if done: env.reset() return obs observations = [random_env_step() for _ in range(50)] display_video(observations, fps=10)
We will push a fix shortly.
I tried this code and got the new error message below:
Worker (PID=106926): process group: /home/haotion/Downloads/avalon/avalon/datagen/godot/datagen.sh --thread_count=4 -U --input_pipe_path=/tmp/science/tmp/34e956a4-e49b-4451-a070-5d9c54185476/godot.log.actions --output_pipe_path=/tmp/science/tmp/34e956a4-e49b-4451-a070-5d9c54185476/godot.log.observations --resolution=256x256 --cuda-gpu-id=0 /tmp/science/data/96e0e954-f4d6-4779-9eb0-6324171e5091/a4953cce-82ce-4b55-a0e4-4efc2fc242ba/config.json' &>> /tmp/science/tmp/34e956a4-e49b-4451-a070-5d9c54185476/godot.log
Worker (PID=106926): TO DEBUG RUN: /home/haotion/Downloads/avalon/avalon/datagen/godot/datagen.sh --thread_count=4 -U --input_pipe_path=/tmp/science/data/96e0e954-f4d6-4779-9eb0-6324171e5091/a4953cce-82ce-4b55-a0e4-4efc2fc242ba/actions.out --output_pipe_path=/tmp/debug_output --resolution=256x256 --cuda-gpu-id=0 /tmp/science/data/96e0e954-f4d6-4779-9eb0-6324171e5091/a4953cce-82ce-4b55-a0e4-4efc2fc242ba/config.json
Impossible world was generated, this was try 0... (reason: Could not find start point within mask)
<IPython.core.display.Video object>
The "Impossible world was generated" happens sometimes when the world generation procedure fails and we have to try again, so getting it occasionally is normal. It's not a problem unless it appears a lot of times.
The "Impossible world was generated" happens sometimes when the world generation procedure fails and we have to try again, so getting it occasionally is normal. It's not a problem unless it appears a lot of times.
But I'm getting this error all the time when I try to run the new quickstart code.
Ah yes, there is a bug in our world generation procedure that it fails the first time it is called. You may ignore it since it appears only once.
(On the other hand, if the world generation gets stuck and generates an invalid world over and over, then that's an actual bug.)
I'm trying to run the quickstart code in readme but got the following error (ubuntu 22.04):