Giter Site home page Giter Site logo

praveen-palanisamy / macad-agents Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 8.0 52 KB

Agents code for Multi-Agent Connected Autonomous Driving (MACAD) described in the paper presented in the Machine Learning for Autonomous Driving Workshop at NeurIPS 2019:

Home Page: https://arxiv.org/abs/1911.04175

Python 95.72% Dockerfile 3.73% Shell 0.56%
autonomous-agents autonomous-driving connected-vehicle deep-reinforcement-learning multi-agent multi-agent-reinforcement-learning

macad-agents's People

Contributors

aizazsharif avatar praveen-palanisamy avatar shitianyu-hue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

macad-agents's Issues

ModuleNotFoundError: No module named 'macad_gym.envs.intersection.stop_sign_urban_intersection_3c'

Hi, @praveen-palanisamy.
I want to use your code but an error has occurred in my situation. ๐Ÿ˜ข
So I want your help.

I'm sorry for my poor English. ๐Ÿ™‡

Reproduction

Run:

docker run --gpus all -it -e CARLA_SERVER=/software/CarlaUE4.sh -v ${HOME}/src/github.com/praveen-palanisamy/macad-agents:/macad-agents -w /macad-agents/src macad-agents:latest python -m macad_agents.rllib.impala_multiagent_shared_weights.py

Then, this error has occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/opt/conda/lib/python3.6/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/macad-agents/src/macad_agents/rllib/impala_multiagent_shared_weights.py", line 15, in <module>
    from macad_gym.envs.intersection.stop_sign_urban_intersection_3c import \
ModuleNotFoundError: No module named 'macad_gym.envs.intersection.stop_sign_urban_intersection_3c'
Killing live carla processes set()

Environment

  • OS: Ubuntu 18.04.3 LTS
  • Docker: 19.03.5
  • CPU: AMD Ryzen 5 3600X 6-Core Processor
  • GPU: GeForce RTX 2070 (Driver Version: 430.50)

`conda install numpy` won't finish forever

Discussed in #17

Originally posted by rsuwa October 7, 2021

RUN conda install -y numpy

$ docker build --rm -f macad-agents/Dockerfile -t macad-agents:latest .
...

Step 8/15 : RUN conda install -y numpy
 ---> Running in 7123a03249d8
Solving environment: ...working...

No matter how many hours I wait, it stops as described above.

confusion about Baseline_agent

Hello,
I run:
python baseline_agent.py by loading the environment jason file in the intersection environments:
https://github.com/praveen-palanisamy/macad-gym/tree/master/src/macad_gym/envs/intersection

But only one vehicle can be controlled.
I also tried to run the baseline_agent with the default configuration. It is actually a single-vehicle drive straight forward.

Here are my two confusions about the baseline agent:

  1. How to control multi-agent?
    As I saw in the source code:
    for actor_id in actor_configs.keys(): vehicle_dict[actor_id] = env._actors[actor_id]
    I think it should be able to control multi-agent.

  2. How to set the duration of the simulation?

If I want to let the agent run in a longer period(i.e. more time steps per episode), how to change the environment parameters.

Thanks and look forward to your reply

Macad agent scripts running out of resouces

Hi @praveen-palanisamy @SHITIANYU-hue,

I am trying to run an impala agent independent script to train multi-agents. My environment is working fine but all the scripts apparently create multiple Carla instances and it results in freezing my laptop.
I took the screenshot to show the last logs on the terminal for reference.
Screenshot from 2021-02-18 12-42-40

During this screenshot, around 3 to 4 windows get opened and it stucks my laptop unless I reboot.

Any help in this would be appreciated.
Thanks

How to run baseline agent?

I try to run the baseline agent according to this line,

python -m macad_agents.rllib.baseline_agent

But I found this error:

agents.baseline_agent
free(): invalid pointer
Aborted (core dumped)

Impala agent Code Issue

Hi @praveen-palanisamy ,

I am facing trouble while using Macad-agent impala examples. Even if I lower the resources the code runs but the cars don't move at all in default settings and without any training or crash Carla makes several windows of the environment.

Is there any way to verify the training of multi-agents through simulation? This way I can re-run the weights and see the results of multi-agent cars.

Thanks

Ray error when running continuous A3C

Hello,

when I run:

python -m macad_agents.a3c.continuous_A3C_tune.

I found that there will be the following error:
Traceback (most recent call last):
File "/home/tianyushi/miniconda3/envs/macad-gym/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/home/tianyushi/miniconda3/envs/macad-gym/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/tianyushi/code/macad-agents/src/macad_agents/a3c/continuous_A3C_tune.py", line 74, in
"UPDATE_GLOBAL_ITER": 5,
File "/home/tianyushi/miniconda3/envs/macad-gym/lib/python3.6/site-packages/ray/tune/tune.py", line 185, in run_experiments
raise TuneError("Trials did not complete", errored_trials)
ray.tune.error.TuneError: ('Trials did not complete', [continuous_A3C_carla_env_0])
Killing live carla processes set()

and the log file is :
error_2020-08-27_16-06-25.txt

`conda install numpy` won't finish forever

Discussed in #17

Originally posted by rsuwa October 7, 2021

RUN conda install -y numpy

$ docker build --rm -f macad-agents/Dockerfile -t macad-agents:latest .
...

Step 8/15 : RUN conda install -y numpy
 ---> Running in 7123a03249d8
Solving environment: ...working...

No matter how many hours I wait, it stops as described above.

I have the same problem when building the Docker image locally. I tried twice, it always got stuck in here:

Step 8/15 : RUN conda install -y numpy
 ---> Running in 0ae7ce97b684
Solving environment: ...working...

is the continuous_a3c code valid?

I've tried the continuous_A3C.py, there exists some problems.

Problem

1. Incorrect dictionary update

env_config = DEFAULT_MULTIENV_CONFIG
config_update = update_scenarios_parameter(
json.load(open("macad_agents/a3c/env_config.json")))
env_config.update(config_update)

Use dict.update to update a dictionary will override pre-exists keys in the dict, such as:

(d1,d2) = ({"Country":{}},{"Country":{}})
d1['Country']['area'] = 960
d2['Country']['population'] = 14

d1.update(d2) # The 'area' key will be replaced by 'population'

This will cause the "fixed_delta_seconds" key to be lost, as a result macad-gym can't initialize.

2. Serialization Problem

class Worker(mp.Process):
def __init__(self, gnet, opt, global_ep, global_ep_r, res_queue, name):
super(Worker, self).__init__()
self.name = 'w%i' % name
self.g_ep, self.g_ep_r, self.res_queue = (global_ep, global_ep_r,
res_queue)
self.gnet, self.opt = gnet, opt
self.lnet = Net(N_S.spaces[vehicle_name],
N_A.spaces[vehicle_name]) # local network
self.env = MultiCarlaEnv(env_config)

Putting environment inside Net is not a good idea, when mp.Process serialize this object, it will try to serialize the environment as well, resulting in "can't pickle pygame.Font object" error.

Training

Even though I fixed those problems, it still doesn't seem to work. The "Mean Reward Curve" doesn't tend to go up (nor the distance curve to go down), and I haven't achieved one success episode yet (3M steps, maybe it's not enough to draw a conclusion?).

pic1

I know that PPO and IMPALA are the recommended algorithms, but since A3C is available in the repo, I want to know if it actually works.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.