praveen-palanisamy / macad-gym

Multi-Agent Connected Autonomous Driving (MACAD) Gym environments for Deep RL. Code for the paper presented in the Machine Learning for Autonomous Driving Workshop at NeurIPS 2019:

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use?

lijecaru opened this issue · comments

What are the algorithms included? Do you maybe have some tutorial or documentation to test it? Thank you!

Hi @lijecaru :

There is a "Getting Started" section in the README file and the typical usage of the environments provided by the macad-gym package is illustrated here.

As an example, after you setup CARLA 0.9.x and install macad-gym using the instructions in the README.md, You can find the list of available learning environments and a brief description of the environments using the following 3 lines of code:

import gym
import macad_gym
macad_gym.get_available_envs()

Let's say you want to use the HomoNcomIndePOIntrxMASS3CTWN3-v0 environment, you can then create an environment using the following 3 lines of code:

import gym
import macad_gym
env = gym.make("HomoNcomIndePOIntrxMASS3CTWN3-v0")

These learning environments are OpenAI Gym compatible. Therefore, you can use any standard RL/deep-RL library to train you agents in these environments.
Let me know if you need more information to get started.

@praveen-palanisamy I tried to use macad-gym in the both ways described in the README file.

  1. Installing it as only a user (pip install git+https://github.com/praveen-palanisamy/macad-gym.git) doesn't provide any error when I run the line import macad_gym, but when I test macad_gym.get_available_envs() I the following message: AttributeError: module 'macad_gym' has no attribute 'get_available_envs'

  2. As a developer, I create the conda environment using the .yaml file, but when I ran again import macad_gym I get the following: ModuleNotFoundError: No module named 'macad_gym'
    So, I went to the Conda env and searched for the macad_gym folder, i found that it wasn't anywhere in the new environment, so I copied the folders macad_gym and macad_gym-0.0.1.post0.dist-info from the previous environment I created (step 1). After that I ran import macad_gym without problems, but when I test macad_gym.get_available_envs() I the following message: AttributeError: module 'macad_gym' has no attribute 'get_available_envs', exactly the same as before.

I am using Ubuntu 16.04 and Anaconda3. Any idea of what I could do to solve this? Thank you

Hi @lijecaru,
You actually had them all right! The function name to get the list of available environments in the latest version is: list_available_envs. So, please use: macad_gym.list_avaialble_envs() and it should work.

Thanks for reporting this. I have updated the README to reflect the change as per the latest version. The reason why you get ModuleNotFoundError: No module named 'macad_gym' in your case 2. is because, you might have not installed the macad-gym package. You can use: pip install -e . from the macad-gym folder after you have cloned this repo. I have updated the README to reflect this as well.

Hope that gets you rolling. Let me know if you face any other issue.