Giter Club home page Giter Club logo

autonomous-driving-in-carla-using-deep-reinforcement-learning's Introduction

IDREES here! 👋

This is what I'm doing these days

  • 🔭 I’m currently working on ... my Java Project
  • 🌱 I’m currently learning ...Mojo
  • 👯 I’m looking to collaborate on ... *Machine Learning Projects.
  • 💬 Ask me about ...Anything
  • 📫 How to reach me: linkedIn
  • 😄 Pronouns: ... He/Him

By the end of the year I will be starting my WEBPAGE where I will upload material every week --> https://idreesshaikh.github.io/

Software Engineer with 2+ years of experience developing technology-driven solutions for multinational corporations. Proficient in software development and deep learning technologies, I specialize in crafting innovative products to address evolving business needs. I am a driven individual dedicated to ongoing learning and professional growth, poised to excel in your team and drive future-focused solutions.

autonomous-driving-in-carla-using-deep-reinforcement-learning's People

Contributors

dependabot[bot] avatar idreesshaikh 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

autonomous-driving-in-carla-using-deep-reinforcement-learning's Issues

Why can't agents train using gpu?

I see the torch. device ('cpu ') in your code. I tried to modify it to torch. device ('cuda: 0'), but it doesn't seem to work.
my torch.cuda.is_ available() returns true.

Messed up video in pygame

Thank you so much for your work, I have successfully run the code using the instruction python continuous_driver.py --exp-name=ppo --train=False, but there is an issue that is confusing me, as you can see in the image below, I'm not sure why the video inside the pygame window looks like this.
I would be very grateful if you can give me some tips!

screenshot 2023-09-04 194257

pygame.error: Unable to make GL context current

Thank you so much for your work.But when I run the code using the instruction python continuous_driver.py --exp-name=ppo --train=False, there is an error as follows.

Traceback (most recent call last):
File "/home/**/Autonomous-Driving-in-Carla-using-Deep-Reinforcement-Learning-main/simulation/sensors.py", line 63, in self.sensor.listen(lambda image: CameraSensorEnv._get_third_person_camera(weak_self, image)) File "/home//Autonomous-Driving-in-Carla-using-Deep-Reinforcement-Learning-main/simulation/sensors.py", line 87, in _get_third_person_camera pygame.display.flip()
pygame.error: Unable to make GL context current

I would be very grateful if you can give me some tips!

Training does not work properly and agent does not beyond first traffic light in TOWN02

Hello Idree,

I was going through your code, and I had a question about a specific part of it. I was training a new agent from scratch in TOWN02. The training was going well (the average reward is increasing every timestep), however, out of a sudden at any point the training stopped and then “exit” is printed in the command window prompt. Basically, the training is not finished, and it does not get to the end of the training (the print “Terminating the run” does never appear). I run the training several times and still doing the same situation but at different timesteps. I am making sure that in the while loop timestep < TOTAL_TIMESETPS, does not break because of this condition. I have attached a screenshot of the situation when the training stops and jumps to the printed exit. I don’t know if run into a similar issue.

Another issue is that the agent does not go beyond the first traffic light corner. I run the code until 2M timesteps but every time the agent restart and stops in that specific point. I don't not if this issue is related to training is stopped unexpected.

Thank you,
Oscar
Training_Stop

checkpoint is not optimal

I ran continuous_drive.py in town02 using checkpoint_ppo_12.pickle , but the car's behavior with the provided checkpoint network parameters is not optimal, if you have any updated or improved checkpoint files available that might enhance the self-driving capabilities of the code.

How long training takes?

Hello,

I am currently training the PPO AV. I am using town 2 for the training process. However, the training does not seem to improve a lot every minute. It started in average reward 97. After 330 episodes, the average reward is 144. How long does it take to train a proper and safe AV? And how many episodes are required to complete a "full" training?

Thank you,
-Oscar

There may be some errors in your code

The 42nd line of code in the sensors.py file under the simulation folder,it seems like reshape((image.height, image.width, 4)) instead of reshape((image.width, iamge.height, 4)).If this error is true, your preTrained_models may need to be updated with the correct version.

Couldn't inport Carla egg properly

I tried to run this code on a Linux system, and replaced the corresponding libraries (such as torch, torchvision and tensorboard) with the Linux version in the project setup phase. It passed the compilation during the poetry update, but an error occurred when running the continuous_driver.py file:

(venv) ......$ python continuous_driver.py --exp-name=Ppo --train=False
Couldn't inport Carla egg properly
pygame 2.1.2(SDL 2.0.16,Python 3.7.13)
Hello fron the pygane coRnunity. https://www. pygane.org/contribute.html
Failed to nake a connection with the server: module 'carla' has no attribute 'client'
ERROR : root:connection has been refused by the server.
Exit
Traceback (most recent call last):
File "continuous_driver.py", line 297, in <module>runner()
File "continuous_driver.py" , line 115, in runner
env = CarlaEnvironment(client, world,town,checkpoint_frequency=None)UnboundLocalError: local variable 'client' referenced before assignnent

I have opened CarlaUE4Editor and started running before running the code. I opened the carla folder of the code and found only the carla-0.9.8-py3.7-win-amd64.egg file. This is not compatible with the Linux system. How can I make the code run correctly on the Linux system?

pygame show

The image displayed on my pygame is incorrect. Is there a problem with yours

Description issues

From the code, it is more like a DDPG algorithms but not PPO algorithms. Besides, for the auto-encoder part, this code is not use auto-encoder to extract features of input image, which looks use encoder as the CNNs. Why not learn and update the weight of these CNNs with actor and critics network? Why need to train these CNNs separately?

Not able to run discrete or continous file

Hi,
When I run the continous file I got this error:

##################################################################################################
python continuous_driver.py --exp-name ppo --town Town07
##################################################################################################
Couldn't import Carla egg properly
pygame 2.1.2 (SDL 2.0.16, Python 3.8.10)
Hello from the pygame community. https://www.pygame.org/contribute.html
ERROR:root:Connection has been refused by the server.

Exit
Traceback (most recent call last):
File "continuous_driver.py", line 330, in
runner()
File "continuous_driver.py", line 146, in runner
env = CarlaEnvironment(client, world,town)
UnboundLocalError: local variable 'client' referenced before assignment

##################################################################################################

As I am getting error related to egg file. I also add these lines in the continous flie:
try:
import pygame
except ImportError:
raise RuntimeError('cannot import pygame, make sure pygame package is installed')

try:
import numpy as np
except ImportError:
raise RuntimeError('cannot import numpy, make sure numpy package is installed')
except ImportError:
raise RuntimeError('cannot import pygame, make sure pygame package is installed')

Calra module

try:
sys.path.append(glob.glob('../carla/dist/carla-*%d.%d-%s.egg' % (
sys.version_info.major,
sys.version_info.minor,
'win-amd64' if os.name == 'nt' else 'linux-x86_64'))[0])
except IndexError:
pass

##################################################################################################

But still I am getting the error related to the egg flie. My other files are working perfectly in CARLA.

When I run the file for discrete file. I got this error.

python3 discrete_driver.py
Couldn't import Carla egg properly
pygame 2.1.2 (SDL 2.0.16, Python 3.8.10)
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "discrete_driver.py", line 16, in
from networks.off_policy.ddqn.agent import DQNAgent
File "/home/Autonomous-Driving-in-Carla-using-Deep-Reinforcement-Learning-main/networks/off_policy/ddqn/agent.py", line 4, in
from networks.off_policy.ddqn.dueling_dqn import DuelingDQnetwork
File "/home/Autonomous-Driving-in-Carla-using-Deep-Reinforcement-Learning-main/networks/off_policy/ddqn/dueling_dqn.py", line 5, in
from parameters import DQN_LEARNING_RATE, DQN_CHECKPOINT_DIR, TOWN7
ImportError: cannot import name 'TOWN7' from 'parameters' (/home/ryzen/Autonomous-Driving-in-Carla-using-Deep-Reinforcement-Learning-main/parameters.py)

So I add this line in parameters.py file
TOWN7 = "Town07"

And then I got this error:

python3 discrete_driver.py
Couldn't import Carla egg properly
pygame 2.1.2 (SDL 2.0.16, Python 3.8.10)
Hello from the pygame community. https://www.pygame.org/contribute.html

Exit
Traceback (most recent call last):
File "discrete_driver.py", line 212, in
runner()
File "discrete_driver.py", line 57, in runner
writer = SummaryWriter(f"runs/{run_name}/{town}")
UnboundLocalError: local variable 'run_name' referenced before assignment

How to resolve both these errors?

bug

hi, when i run the code, i find that it will stop because logprobs is the same as old_logprobs in agent.py

The console works, but the client displays a faulty screen!

The console works, but the client displays a faulty screen!
The console works, but the client displays a faulty screen!
The client's GUI display screen, not fully displayed, is a pair of horizontal stripes! I don't know what is the reason for this. I don't know what's causing this, so I'm asking for your help! Please give me a suggestion!
The interface of the client is full of horizontal stripes, there is no way to display my car and planning level properly, the interface is full of horizontal stripes!

You MPDF seems like the same as two single PDF ?

Hi,
I really appreciate this work! However, I think the Multivariate(steer, throttle) Probability Distribution Function in this project works as the same way like Two Single Gaussian PDF for you don't consider the Rho between with steer and throttle ?

Codes in PPO in line 19:
self.cov_var = torch.full((self.action_dim, ), action_std_init)
self.cov_mat = torch.diag(self.cov_var).unsqueeze(dim=0). It's a diag matrix which consider the Rho is 0 ? And what the difference if you use two single Gaussian PDF for sampling the actions? Any ablation experiments ?

Best wishes !

Hardwares

Hi, i just want to know what hardwares did you run the project on? Specially cpu modal, gpu modal and memory, ram memory, motherboard modal?

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.