BASALT-2022-Karlsruhe / ka-basalt-2022

MIT License
0 stars 0 forks source link

Error on reset() when using wrapped MineRL env #71

Closed rk1a closed 1 year ago

rk1a commented 1 year ago

How to reproduce? Run this as main: https://github.com/BASALT-2022-Karlsruhe/ka-basalt-2022/blob/RL_policy_finetuning/sb3_policy_wrapper.py

root@497af7050406:/home/aicrowd# python sb3_policy_wrapper.py Using cuda device Wrapping the env with a Monitor wrapper Wrapping the env in a DummyVecEnv. /home/aicrowd/.conda/envs/minerl/lib/python3.8/runpy.py:127: RuntimeWarning: 'minerl.utils.process_watcher' found in sys.modules after import of package 'minerl.utils', but prior to execution of 'minerl.utils.process_watcher'; this may result in unpredictable behaviour warn(RuntimeWarning(msg)) Traceback (most recent call last): File "sb3_policy_wrapper.py", line 227, in model.learn(1) File "/home/aicrowd/.conda/envs/minerl/lib/python3.8/site-packages/stable_baselines3/ppo/ppo.py", line 299, in learn return super(PPO, self).learn( File "/home/aicrowd/.conda/envs/minerl/lib/python3.8/site-packages/stable_baselines3/common/on_policy_algorithm.py", line 242, in learn total_timesteps, callback = self._setup_learn( File "/home/aicrowd/.conda/envs/minerl/lib/python3.8/site-packages/stable_baselines3/common/base_class.py", line 429, in _setup_learn self._last_obs = self.env.reset() # pytype: disable=annotation-type-mismatch File "/home/aicrowd/.conda/envs/minerl/lib/python3.8/site-packages/stable_baselines3/common/vec_env/dummy_vec_env.py", line 61, in reset obs = self.envs[env_idx].reset() File "/home/aicrowd/.conda/envs/minerl/lib/python3.8/site-packages/stable_baselines3/common/monitor.py", line 79, in reset return self.env.reset(kwargs) File "/home/aicrowd/gym_wrappers.py", line 25, in reset initial_obs = self.env.reset() File "/home/aicrowd/gym_wrappers.py", line 152, in reset obs = self.env.reset() File "/home/aicrowd/.conda/envs/minerl/lib/python3.8/site-packages/gym/core.py", line 251, in reset return self.env.reset(kwargs) File "/home/aicrowd/.conda/envs/minerl/lib/python3.8/site-packages/gym/wrappers/time_limit.py", line 27, in reset return self.env.reset(kwargs) File "/home/aicrowd/.conda/envs/minerl/lib/python3.8/site-packages/minerl/herobraine/env_specs/basalt_specs.py", line 78, in reset return self.env.reset() File "/home/aicrowd/.conda/envs/minerl/lib/python3.8/site-packages/minerl/herobraine/env_specs/basalt_specs.py", line 57, in reset return super().reset() File "/home/aicrowd/.conda/envs/minerl/lib/python3.8/site-packages/gym/core.py", line 251, in reset return self.env.reset(kwargs) File "/home/aicrowd/.conda/envs/minerl/lib/python3.8/site-packages/minerl/env/_singleagent.py", line 22, in reset multi_obs = super().reset() File "/home/aicrowd/.conda/envs/minerl/lib/python3.8/site-packages/minerl/env/_multiagent.py", line 436, in reset self._setup_instances() File "/home/aicrowd/.conda/envs/minerl/lib/python3.8/site-packages/minerl/env/_multiagent.py", line 539, in _setup_instances self.instances.extend([f.result() for f in instance_futures]) File "/home/aicrowd/.conda/envs/minerl/lib/python3.8/site-packages/minerl/env/_multiagent.py", line 539, in self.instances.extend([f.result() for f in instance_futures]) File "/home/aicrowd/.conda/envs/minerl/lib/python3.8/concurrent/futures/_base.py", line 437, in result return self.get_result() File "/home/aicrowd/.conda/envs/minerl/lib/python3.8/concurrent/futures/_base.py", line 389, in get_result raise self._exception File "/home/aicrowd/.conda/envs/minerl/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/home/aicrowd/.conda/envs/minerl/lib/python3.8/site-packages/minerl/env/_multiagent.py", line 805, in _get_new_instance instance.launch(replaceable=self._is_fault_tolerant) File "/home/aicrowd/.conda/envs/minerl/lib/python3.8/site-packages/minerl/env/malmo.py", line 427, in launch raise EOFError( EOFError: /home/aicrowd/.conda/envs/minerl/lib/python3.8/site-packages/minerl/env/../MCP-Reborn SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. [22:33:03] [Render thread/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD' [22:33:03] [Render thread/ERROR]: Failed to verify authentication! [22:33:03] [Render thread/INFO]: Setting user: Player419 [22:33:03] [Render thread/INFO]: Backend library: LWJGL version 3.2.2 SNAPSHOT ---- Minecraft Crash Report ---- // My bad.

Time: 10/5/22 10:33 PM Description: Initializing game

java.lang.IllegalStateException: Failed to initialize GLFW, errors: GLFW error during init: [0x10008]140485421342400 at com.mojang.blaze3d.platform.GLX._initGlfw(GLX.java:80) at com.mojang.blaze3d.systems.RenderSystem.initBackendSystem(RenderSystem.java:586) at net.minecraft.client.Minecraft.(Minecraft.java:406) at net.minecraft.client.main.Main.main(Main.java:154)

A detailed walkthrough of the error, its code path and all known details is as follows:

-- Head -- Thread: Render thread Stacktrace: at com.mojang.blaze3d.platform.GLX._initGlfw(GLX.java:80) at com.mojang.blaze3d.systems.RenderSystem.initBackendSystem(RenderSystem.java:586) at net.minecraft.client.Minecraft.(Minecraft.java:406)

-- Initialization -- Details: Stacktrace: at net.minecraft.client.main.Main.main(Main.java:154)

-- System Details -- Details: Minecraft Version: 1.16.5 Minecraft Version ID: 1.16.5 Operating System: Linux (amd64) version 5.8.0-43-generic Java Version: 1.8.0_342, Private Build Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Private Build Memory: 792490608 bytes (755 MB) / 1225785344 bytes (1169 MB) up to 3817865216 bytes (3641 MB) CPUs: 6 JVM Flags: 1 total; -Xmx4G Launched Version: NULL Backend library: LWJGL version 3.2.2 SNAPSHOT Backend API: NO CONTEXT GL Caps: Using VBOs: Yes Is Modded: Very likely; Jar signature invalidated Type: Client (map_client.txt) CPU:

@!@# Game crashed! Crash report saved to: #@!@# /home/aicrowd/.conda/envs/minerl/lib/python3.8/site-packages/minerl/MCP-Reborn/./crash-reports/crash-2022-10-05_22.33.04-client.txt

Minecraft process finished unexpectedly. There was an error with Malmo.

rk1a commented 1 year ago

Resolved using this https://github.com/minerllabs/minerl/issues/659#issuecomment-1209799298