运行 vizdoom 和 pytorch 程序在 Linux 的 Windows 子系统上时出现多进程锁定错误
Getting multiprocessing lock error when running vizdoom and pytorch program on Windows Subsystem for Linux
每当我尝试在 WSL 上 运行 我的程序时,我都会收到以下错误。我是pytorch和vizdoom的新手,所以我不知道如何解决这个问题。
设置
- Windows 10 x64
- Ubuntu 14(WSL)
- Python 2.7.14(蟒蛇 2)
- OpenAI 健身房 0.9.5
- Vizdoom 1.1.4
- 厄运-py 0.0.14
- ppaquette/gym-doom
- 火炬 0.0.12
(doomenv) hybridsyntax@Blacklynx:/mnt/f/_TUTORIALS/ai/doom/code$ python ai.py > wsl.log
[2018-05-25 18:21:44,354] Making new env: ppaquette/DoomCorridor-v0
[2018-05-25 18:21:44,365] Clearing 2 monitor files from previous run (because force=True was provided)
Assertion 'pthread_mutex_unlock(&m->mutex) == 0' failed at pulsecore/mutex-posix.c:108, function pa_mutex_unlock(). Aborting.
Traceback (most recent call last):
File "ai.py", line 155, in <module>
memory.run_steps(200)
File "/mnt/f/_TUTORIALS/ai/doom/code/experience_replay.py", line 70, in run_steps
entry = next(self.n_steps_iter) # 10 consecutive steps
File "/mnt/f/_TUTORIALS/ai/doom/code/experience_replay.py", line 21, in __iter__
state = self.env.reset()
File "/mnt/f/_TUTORIALS/ai/doom/gym/gym/core.py", line 104, in reset
return self._reset()
File "/mnt/f/_TUTORIALS/ai/doom/gym/gym/wrappers/monitoring.py", line 39, in _reset
observation = self.env.reset(**kwargs)
File "/mnt/f/_TUTORIALS/ai/doom/gym/gym/core.py", line 104, in reset
return self._reset()
File "/mnt/f/_TUTORIALS/ai/doom/gym/gym/core.py", line 311, in _reset
observation = self.env.reset(**kwargs)
File "/mnt/f/_TUTORIALS/ai/doom/gym/gym/core.py", line 104, in reset
return self._reset()
File "/mnt/f/_TUTORIALS/ai/doom/gym/gym/wrappers/frame_skipping.py", line 33, in _reset
return self.env.reset()
File "/mnt/f/_TUTORIALS/ai/doom/gym/gym/core.py", line 104, in reset
return self._reset()
File "/mnt/f/_TUTORIALS/ai/doom/gym/gym/core.py", line 283, in _reset
return self.env.reset(**kwargs)
File "/mnt/f/_TUTORIALS/ai/doom/gym/gym/core.py", line 104, in reset
return self._reset()
File "/mnt/f/_TUTORIALS/ai/doom/gym/gym/wrappers/time_limit.py", line 49, in _reset
return self.env.reset()
File "/mnt/f/_TUTORIALS/ai/doom/gym/gym/core.py", line 104, in reset
return self._reset()
File "/mnt/f/_TUTORIALS/ai/doom/gym-doom/ppaquette_gym_doom/doom_env.py", line 244, in _reset
return self._load_level()
File "/mnt/f/_TUTORIALS/ai/doom/gym-doom/ppaquette_gym_doom/doom_env.py", line 157, in _load_level
'singleton lock in memory.')
gym.error.Error: [ViZDoomUnexpectedExitException, ViZDoomErrorException] VizDoom exited unexpectedly. This is likely caused by a missing multiprocessing lock. To run VizDoom across multiple processes, you need to pass a lock when you configure the env [e.g. env.configure(lock=my_multiprocessing_lock)], or create and close an env before starting your processes [e.g. env = gym.make("DoomBasic-v0"); env.close()] to cache a singleton lock in memory.
[2018-05-25 18:21:44,696] Finished writing results. You can upload them to the scoreboard via gym.upload('/mnt/f/_TUTORIALS/ai/doom/code/videos')
(doomenv) hybridsyntax@Blacklynx:/mnt/f/_TUTORIALS/ai/doom/code$
提前致谢
将 WSL 上的 Ubuntu 升级到最新版本 (18.04) 解决了我的问题。
对我来说 运行 WSL 上的以下命令。
sudo -S env RELEASE_UPGRADER_NO_SCREEN=1 do-release-upgrade
sudo apt-get update
sudo apt-get upgrade -y
每当我尝试在 WSL 上 运行 我的程序时,我都会收到以下错误。我是pytorch和vizdoom的新手,所以我不知道如何解决这个问题。
设置
- Windows 10 x64
- Ubuntu 14(WSL)
- Python 2.7.14(蟒蛇 2)
- OpenAI 健身房 0.9.5
- Vizdoom 1.1.4
- 厄运-py 0.0.14
- ppaquette/gym-doom
- 火炬 0.0.12
(doomenv) hybridsyntax@Blacklynx:/mnt/f/_TUTORIALS/ai/doom/code$ python ai.py > wsl.log
[2018-05-25 18:21:44,354] Making new env: ppaquette/DoomCorridor-v0
[2018-05-25 18:21:44,365] Clearing 2 monitor files from previous run (because force=True was provided)
Assertion 'pthread_mutex_unlock(&m->mutex) == 0' failed at pulsecore/mutex-posix.c:108, function pa_mutex_unlock(). Aborting.
Traceback (most recent call last):
File "ai.py", line 155, in <module>
memory.run_steps(200)
File "/mnt/f/_TUTORIALS/ai/doom/code/experience_replay.py", line 70, in run_steps
entry = next(self.n_steps_iter) # 10 consecutive steps
File "/mnt/f/_TUTORIALS/ai/doom/code/experience_replay.py", line 21, in __iter__
state = self.env.reset()
File "/mnt/f/_TUTORIALS/ai/doom/gym/gym/core.py", line 104, in reset
return self._reset()
File "/mnt/f/_TUTORIALS/ai/doom/gym/gym/wrappers/monitoring.py", line 39, in _reset
observation = self.env.reset(**kwargs)
File "/mnt/f/_TUTORIALS/ai/doom/gym/gym/core.py", line 104, in reset
return self._reset()
File "/mnt/f/_TUTORIALS/ai/doom/gym/gym/core.py", line 311, in _reset
observation = self.env.reset(**kwargs)
File "/mnt/f/_TUTORIALS/ai/doom/gym/gym/core.py", line 104, in reset
return self._reset()
File "/mnt/f/_TUTORIALS/ai/doom/gym/gym/wrappers/frame_skipping.py", line 33, in _reset
return self.env.reset()
File "/mnt/f/_TUTORIALS/ai/doom/gym/gym/core.py", line 104, in reset
return self._reset()
File "/mnt/f/_TUTORIALS/ai/doom/gym/gym/core.py", line 283, in _reset
return self.env.reset(**kwargs)
File "/mnt/f/_TUTORIALS/ai/doom/gym/gym/core.py", line 104, in reset
return self._reset()
File "/mnt/f/_TUTORIALS/ai/doom/gym/gym/wrappers/time_limit.py", line 49, in _reset
return self.env.reset()
File "/mnt/f/_TUTORIALS/ai/doom/gym/gym/core.py", line 104, in reset
return self._reset()
File "/mnt/f/_TUTORIALS/ai/doom/gym-doom/ppaquette_gym_doom/doom_env.py", line 244, in _reset
return self._load_level()
File "/mnt/f/_TUTORIALS/ai/doom/gym-doom/ppaquette_gym_doom/doom_env.py", line 157, in _load_level
'singleton lock in memory.')
gym.error.Error: [ViZDoomUnexpectedExitException, ViZDoomErrorException] VizDoom exited unexpectedly. This is likely caused by a missing multiprocessing lock. To run VizDoom across multiple processes, you need to pass a lock when you configure the env [e.g. env.configure(lock=my_multiprocessing_lock)], or create and close an env before starting your processes [e.g. env = gym.make("DoomBasic-v0"); env.close()] to cache a singleton lock in memory.
[2018-05-25 18:21:44,696] Finished writing results. You can upload them to the scoreboard via gym.upload('/mnt/f/_TUTORIALS/ai/doom/code/videos')
(doomenv) hybridsyntax@Blacklynx:/mnt/f/_TUTORIALS/ai/doom/code$
提前致谢
将 WSL 上的 Ubuntu 升级到最新版本 (18.04) 解决了我的问题。
对我来说 运行 WSL 上的以下命令。
sudo -S env RELEASE_UPGRADER_NO_SCREEN=1 do-release-upgrade
sudo apt-get update
sudo apt-get upgrade -y