Skip to content
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

Semaphore is busy issue #6

Open
qbzztz123 opened this issue Jan 14, 2025 · 2 comments
Open

Semaphore is busy issue #6

qbzztz123 opened this issue Jan 14, 2025 · 2 comments

Comments

@qbzztz123
Copy link

Dear author
I meet "posix_ipc.BusyError: Semaphore is busy" problem when I begin training SAC algorithm. It always happens when the algorithm has been trained for 15 episodes or more. The problem detail is in the attached pictures.
2025-01-14 16-25-15 的屏幕截图
I wonder if you have encountered it before. If so, please offer me some useful solution. Any help is important for me.
The dependency I use is Holoocean 1.0.0, and I run this project on RTX2060 GPU.

@qbzztz123
Copy link
Author

Here is the copy of the problem.
Traceback (most recent call last):
File "/home/cwh/RL_AUV_tracking/SB3_learning.py", line 449, in
main()
File "/home/cwh/RL_AUV_tracking/SB3_learning.py", line 229, in main
learn(env, model_dir, log_dir)
File "/home/cwh/RL_AUV_tracking/SB3_learning.py", line 307, in learn
model.learn(total_timesteps=1000000, tb_log_name="first_run", log_interval=5, callback=callback)
File "/home/cwh/anaconda3/envs/RL_AUV_Tracking/lib/python3.10/site-packages/stable_baselines3/sac/sac.py", line 307, in learn
return super().learn(
File "/home/cwh/anaconda3/envs/RL_AUV_Tracking/lib/python3.10/site-packages/stable_baselines3/common/off_policy_algorithm.py", line 328, in learn
rollout = self.collect_rollouts(
File "/home/cwh/anaconda3/envs/RL_AUV_Tracking/lib/python3.10/site-packages/stable_baselines3/common/off_policy_algorithm.py", line 560, in collect_rollouts
new_obs, rewards, dones, infos = env.step(actions)
File "/home/cwh/anaconda3/envs/RL_AUV_Tracking/lib/python3.10/site-packages/stable_baselines3/common/vec_env/base_vec_env.py", line 206, in step
return self.step_wait()
File "/home/cwh/anaconda3/envs/RL_AUV_Tracking/lib/python3.10/site-packages/stable_baselines3/common/vec_env/vec_monitor.py", line 76, in step_wait
obs, rewards, dones, infos = self.venv.step_wait()
File "/home/cwh/anaconda3/envs/RL_AUV_Tracking/lib/python3.10/site-packages/stable_baselines3/common/vec_env/dummy_vec_env.py", line 58, in step_wait
obs, self.buf_rews[env_idx], terminated, truncated, self.buf_infos[env_idx] = self.envs[env_idx].step(
File "/home/cwh/RL_AUV_tracking/auv_env/display_wrapper.py", line 49, in step
return self.env.step(action)
File "/home/cwh/anaconda3/envs/RL_AUV_Tracking/lib/python3.10/site-packages/gymnasium/wrappers/common.py", line 125, in step
observation, reward, terminated, truncated, info = self.env.step(action)
File "/home/cwh/RL_AUV_tracking/auv_env/base.py", line 130, in step
return self.world.step(action_waypoint=action_waypoint)
File "/home/cwh/RL_AUV_tracking/auv_env/world_auv.py", line 134, in step
self.sensors = self.ocean.tick()
File "/home/cwh/anaconda3/envs/RL_AUV_Tracking/lib/python3.10/site-packages/holoocean/environments.py", line 547, in tick
self._client.acquire(self._timeout)
File "/home/cwh/anaconda3/envs/RL_AUV_Tracking/lib/python3.10/site-packages/holoocean/holooceanclient.py", line 116, in acquire
self._get_semaphore_fn(self._semaphore2, timeout)
File "/home/cwh/anaconda3/envs/RL_AUV_Tracking/lib/python3.10/site-packages/holoocean/holooceanclient.py", line 84, in posix_acquire_semaphore
sem.acquire(timeout)
posix_ipc.BusyError: Semaphore is busy

@Ice-mao
Copy link
Owner

Ice-mao commented Feb 12, 2025

I think it might be an issue related to multi-environment asynchronous communication. Please check the size of your memory, adjust the number of environments, and then give it another try; or you could run separate examples within HoloOcean to see if they work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants