Coder Social home page Coder Social logo

How to use? about macad-gym HOT 3 CLOSED

lijecaru avatar lijecaru commented on June 1, 2024
How to use?

from macad-gym.

Comments (3)

praveen-palanisamy avatar praveen-palanisamy commented on June 1, 2024 1

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.

from macad-gym.

lijecaru avatar lijecaru commented on June 1, 2024

@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

from macad-gym.

praveen-palanisamy avatar praveen-palanisamy commented on June 1, 2024

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.

from macad-gym.

Related Issues (20)

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.