Comments (6)
Hi @praveen-palanisamy, yeap that solves the problem! Thanks a lot for the help!
from macad-gym.
Hi @eerkaijun ,
You are right. The issue is because the Python os
module for Windows doesn't have support for getpgid
and a few other (UNIX-specific) OS commands.
One workaround is to ask subprocess.Popen
to create a new process group (wherein a new process group is created with the process ID as the group ID) which can then be killed/exited programmatically on windows by sending a Ctrl + C
or Ctrl + Break
event.
In summary, the changes for Windows would be to:
- Add
creationflags=subprocess.CREATE_NEW_PROCESS_GROUP
as a new argument and remove thepreexec_fn=os.setsid
argument in the followingPopen
lines:
macad-gym/src/macad_gym/carla/multi_env.py
Lines 407 to 419 in 38884ac
macad-gym/src/macad_gym/carla/multi_env.py
Lines 423 to 435 in 38884ac
- Then, in the
cleanup()
method listed below:
macad-gym/src/macad_gym/carla/multi_env.py
Lines 203 to 206 in 38884ac
Send pgid.send_signal(signal.CTRL_BREAK_EVENT)
Hope the above 2-step workaround works out for you.
from macad-gym.
Thanks so much for the prompt response! I added the lines that you mentioned, but now I'm getting this error:
Initializing new Carla server...
FATAL ERROR while launching server: <class 'AttributeError'>
from macad-gym.
Looks like the error message is clipped/incomplete? Could you please post the full error log or let me know which line cause this error on your end?
Please post the contents of the server_*.log
file as well for any additional info.
from macad-gym.
The error message is not clipped, there's no more lines except the Fatal ERROR line. From the logs, I can see this, which seems to be an issue with the os library in windows again:
Traceback (most recent call last):
File "C:\Eer Kai Jun\Autonomous Driving\env\lib\site-packages\macad_gym\carla\multi_env.py", line 221, in <module>
from ray.rllib.env import MultiAgentEnv
ModuleNotFoundError: No module named 'ray'
DEBUG:macad_gym.carla.multi_env:module 'os' has no attribute 'setsid'
from macad-gym.
Ohh. Okay. Yeah, the setsid
is also not available on Windows. I unfortunately don't yet have a Windows machine setup to test this out now.
The solution is to remove the preexec_fn=os.setsid
argument to Popen
. I have update my comment above(#32 (comment)) to include this change as well for Windows support.
Please give it a try with this change and post what you find.
from macad-gym.
Related Issues (20)
- Unable to use RL algorithms with continuous action space HOT 5
- Increasing number of steps per episode/ iteration HOT 3
- Multiprocess pickle Problem HOT 3
- How to set the spectator on the agent HOT 1
- Does macad-gym support multi-agent algos training? HOT 2
- Also stuck in env.reset() in example HOT 3
- How to create communicating environment?
- How to visualize the learning environment? HOT 2
- Support the library HOT 3
- `multi_view_render` will pop new display window on each frame with latest version of Pygame HOT 6
- The latest pull request is incomplete HOT 3
- gym version will affect the usage of ray[rllib] HOT 2
- PathTracker generate wrong route HOT 2
- when I use urban_signal_intersection_3c env ,happen error,please help me HOT 8
- How to customize a learning environment? HOT 2
- How do we port an existing multi-agent leanring algorithm such as IDDPG, IPPO? HOT 4
- Communication Mechanism
- v0.1.3 carla serve can't get connection HOT 1
- Implement of IMPALA Agent Examples HOT 2
- No support for other sensors? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from macad-gym.