Git Product home page Git Product logo

carla-rl's Introduction

Carla-RL

Reinforcement Learning codebase for self-driving car in Carla

  1. Edit settings in settings.py
  2. Run with train.py
  3. You can just play using play.py.

Add your own models via sources/models.py

carla-rl's People

Contributors

daniel-kukiela avatar sentdex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

carla-rl's Issues

Trainer is always in waiting state

I just started using this after initial setup done right I am able to see agent output and NPc's but the trainer is always in waiting state

How to run these programs?

At first,I downloaded this zip and uncompressed it into the folder D:\carla\PythonAPI\examples,when running the train.py,the result error:
Traceback (most recent call last): File "train.py", line 9, in <module> from sources import start_carla, restart_carla File "D:\carla\PythonAPI\examples\sources\__init__.py", line 2, in <module> from .carla import CarlaEnv, carla as carla_simulator, get_exec_command as get_carla_exec_command, kill_processes as kill_carla_processes, start as start_carla, restart as restart_carla, ACTIONS, ACTIONS_NAMES, CarlaEnvSettings, CARLA_SETTINGS_STATE, CARLA_SETTINGS_STATE_MESSAGE File "D:\carla\PythonAPI\examples\sources\carla.py", line 10, in <module> import carla ModuleNotFoundError: No module named 'carla'
How to run these programs?
Preciate your kind reply.

Problem with the agent connecting to the server (sources/carla.py)

VScode is highlighting many errors in carla.py in every carla. line and I think it's because of this line:
self.client = carla.Client(*settings.CARLA_HOSTS[carla_instance][:2])
In all the other files Carla API is working well, also "CARLA_HOSTS" is set right in settings.py so that doesn't seem to be the problem.
The script runs and the simulator opens but it keeps printing "ERROR" on "Carla1" and in "Agent1" and nothing happens, nor npc's spawn, neither agent. @daniel-kukiela @Sentdex

Fixed timestep?

Is there a way to modify the files to let the agents run at a fixed timestep, or in synchronous mode?

I have tried the usual:

        self.frame = self.world.apply_settings(carla.WorldSettings(no_rendering_mode=False,synchronous_mode=True,fixed_delta_seconds=self.delta_seconds))
        self.clock = pygame.time.Clock()

with no success.

Cant find the "hparams.json" while running the play.py file

While running the reinforced learning code for carla the hparams file was not found and and error was displayed:

Traceback (most recent call last): File "/home/carlauser/Carla-RL/play.py", line 18, in <module> for model in hparams['models']: TypeError: 'NoneType' object is not subscriptable

Any help?

terminate called after throwing an instance of 'std::runtime_error'

the code seems like starting with printing the following:
Starting...
Waiting for Carla...
Calculating weights size...
Starting trainer...
Starting agents...
Ready

it also print some empty stats then it throws this error
terminate called after throwing an instance of 'std::runtime_error'
what(): trying to operate on a destroyed actor; an actor's function was called, but the actor is already destroyed.
Aborted (core dumped)

can anyone help with a possible solution please?
I am using cuda version 10.0
cudnn = 7.4.2
Tensorflow-gpu = 1.14
Gpu nvidia GeForce GTX 1050
Thanks in advance

No module 'settings'

whenever i run all the files i face "No module named 'settings'" this issue, how to solve it ?

can you tell us clearly how to run this repository

Model result

hello,
after training the Xception model over 1000 episode. the restarting episode always come after 2 step, the agent is not moving properly.
is the problem of my PC low performance.
24

CARLA 0.9.5 0 - Python3.5 - Syntax Error - File "Test_1.py", line 311 agent.model.save(f'models/{MODEL_NAME}__{max_reward:_>7.2f}max_{average_reward:_>7.2f}avg_{min_reward:_>7.2f}min__{int(time.time())}.model')

Hi,

System specifications:
OS: Ubuntu 18.04,
Memory: 15.7 GiB,
Processor: AMD® Ryzen 7 3800x 8-core processor × 16,
GPU 4 GiB.
Python Version - 3.5
CARLA Version - 0.9.5

Please find the attached Test_1.py, I am attempting to run, while doing so, I am encountering syntax error - File "Test_1.py", line 311 agent.model.save(f'models/{MODEL_NAME}{max_reward:>7.2f}max{average_reward:>7.2f}avg{min_reward:_>7.2f}min{int(time.time())}.model') (Screenshot Attached).

I couldn't figure out the reason for the sytax error - I even tried to add -- agent.model.save('{}'.format(models/(MODEL_NAME)(max_reward:>7.2f)max(average_reward:>7.2f)avg(min_reward:_>7.2f)min(int(time.time())).model)), Still I encountered the same error.
2020-08-31
CARLA_Test_1_PY.pdf

Can you please help me resolve this problem.

Thanks
Guru

Error: BadShmSeg

Even after over 5000 Episodes the Training doesn't start.
The following error messages keep popping up:

X Error: BadShmSeg (invalid shared segment parameter) 128
  Extension:    130 (MIT-SHM)
  Minor opcode: 3 (X_ShmPutImage)
  Resource id:  0x2c0000e

I'm running the training inside a docker container using the following command:

docker run -it --gpus all -v /tmp/.X11-unix:/tmp/.X11-unix \
 -v ~/.Xauthority:/home/root/.Xauthority \
--link carla_server \
-u 1000 \
--env DISPLAY=:0 sentdex_carla_rl_image bash -c '
echo started & \
socat TCP-LISTEN:2000,fork TCP:carla_server:2000 & \
socat TCP-LISTEN:2001,fork TCP:carla_server:2001 & \
sleep 1 && \
#./carla_095/PythonAPI/examples/manual_control.py && \
python3 train.py
'

Nothing happens

when i run play.py or any other scripts, nothing happens, no error or any kind of output.
i have installed all the dependencies and the server is running without issue. ?

Cannot present continuous image through cv2.imshow() while receiving camera data from Carla

I'm learning the program from https://pythonprogramming.net/control-camera-sensor-self-driving-autonomous-cars-carla-python/ and run the code in this website on ubuntu 18.04,python 3.6 and carla 0.9.9, but I cannot get continuous images through the following code:
def process_img(image): i = np.array(image.raw_data) i2 = i.reshape((IM_HEIGHT, IM_WIDTH, 4)) i3 = i2[:, :, :3] cv2.imshow("", i3) cv2.waitKey(1) return i3/255.0
The image is freezing in the first frame which is strange, I really don't know what's going wrong with it and sincerely hoping for any help. Thank you very much!

This code does not run.

TensorFlow 1.13.1 Keras 2.2.4
CUDA 10.0.130
cudnn 7.4
I ran train.py in the environment, but it falls into an infinite loop. I do not know the reason.

Models not saved in models folder

Hi all,

Atlhough I have set the save chekpoint flag at every 100 episodes my models folder seems to be empty. Do you know why this might be the case?

I ran the code with just python train.py and although I do see the training stats I can't find the model anywhere

Best,

Filip

when i run train.py i get to starting Carla and then it crashes

so when i run train.py carla simulator starts and then in the terminal it says starting carla and then i get the error:

streaming client: connection failed: No connection could be made because the target machine actively refused it
INFO: streaming client: connection failed: No connection could be made because the target machine actively refused it

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.