Luca96 / carla-driving-rl-agent

Code for the paper "Reinforced Curriculum Learning for Autonomous Driving in CARLA" (ICIP 2021)
MIT License
104 stars 26 forks source link

I can't run the program successfully #20

Closed 12kobe closed 2 years ago

12kobe commented 2 years ago

Hello, I am a novice, I spent a lot of time trying to run your program again, after solving many problems, I can't solve this problem now, could you please help me to see how to solve it? Thank you very much. I really want to run this program successfully!

1662629014(1)
Luca96 commented 2 years ago

Hi, it can be due to the version of OpenAI gym try installing version 0.22 or older.

Let me know if the issue still occurs

12kobe commented 2 years ago

Hi, it can be due to the version of OpenAI gym try installing version 0.22 or older.

Let me know if the issue still occurs

1662645041(1)

Hello, thank you very much for your timely answer, which is very important for me as I am eager to solve the problem. Just now I checked the version of the GYM in my virtual environment, which is already 0.26.0 version. So I guess it may not be the version of GYM!Can you see the picture? I don't know why uploading pictures doesn't work

Luca96 commented 2 years ago

Yes I can see the picture, and in fact your version of gym is newer! Try installing an older one, e.g pip install gym==0.22.0, and see if the error is still there

12kobe commented 2 years ago

Yes I can see the picture, and in fact your version of gym is newer! Try installing an older one, e.g pip install gym==0.22.0, and see if the error is still there

Hello, thank you very much for your answer. I have successfully run your program. This is the first program about reinforcement learning that I have successfully reproduced. I am very happy. Thank you again! In addition, I have a few small questions to ask you. First, I find that the frame number of the picture is very low, which leads to the image of pyGame's camera being particularly blurred, and the image of Carla is also very blurred. Is there any way to make it clearer? Second, I found that Carla and pygame are lagging when running the program, and after running for a while, pyGame would not respond, and then it and Carla would crash. What is the reason and what is the solution? My computer is configured with AMD ryzen 7 5800h, rtx3060 laptop GPU and 16g running memory. Is my computer not configured enough? Third, I have learned the basics of reinforcement learning at present. I want to learn more about how reinforcement learning should be applied by learning your code. There may be a lot of things I don't understand when I study your code. I want to ask you if there are any questions at that time! I don't know if you have wechat. Can you add one conveniently? I promise not to disturb you frequently! Thank you again!

Luca96 commented 2 years ago

Hi and sorry for the late response.

In general the framerate is low, at most I managed to achieve 10-15 FPS. This is mainly due to the CARLA simulator itself but also to the agent's network that has to process 3 90x120x3 camera images at each frame.

As you can see here, you can set both the camera resolution and the size of the pygame window. I picked these settings for best performance over quality, also because the memory consumption is quite high (https://github.com/Luca96/carla-driving-rl-agent/issues/10). Moreover, also the simulator quality is set to low: see the repo's README; in general, when you lunch CARLA, you should remove the argument --quality-level=Low, but expect slower performance. Refer to also this issue https://github.com/Luca96/carla-driving-rl-agent/issues/12.

Your computer have an adeguate CPU, but both the GPU and RAM memory are a bit small. So, you have to consider to reduce the batch size and also the number of timesteps, and/or the image resolution.

For further details about the code, see these issues: https://github.com/Luca96/carla-driving-rl-agent/issues/11, https://github.com/Luca96/carla-driving-rl-agent/issues/8, https://github.com/Luca96/carla-driving-rl-agent/issues/4, and https://github.com/Luca96/carla-driving-rl-agent/issues/18.

If you want to better understand the code, you should learn the CARLA API first (https://carla.readthedocs.io/en/latest/start_quickstart/), and you should also take a reinforcement learning course (this is a good place to start.)

Lastly, if you need to contact me, please do this only via email. Thanks.

12kobe commented 2 years ago

Hi and sorry for the late response.

In general the framerate is low, at most I managed to achieve 10-15 FPS. This is mainly due to the CARLA simulator itself but also to the agent's network that has to process 3 90x120x3 camera images at each frame.

As you can see here, you can set both the camera resolution and the size of the pygame window. I picked these settings for best performance over quality, also because the memory consumption is quite high (#10). Moreover, also the simulator quality is set to low: see the repo's README; in general, when you lunch CARLA, you should remove the argument --quality-level=Low, but expect slower performance. Refer to also this issue #12.

Your computer have an adeguate CPU, but both the GPU and RAM memory are a bit small. So, you have to consider to reduce the batch size and also the number of timesteps, and/or the image resolution.

For further details about the code, see these issues: #11, #8, #4, and #18.

If you want to better understand the code, you should learn the CARLA API first (https://carla.readthedocs.io/en/latest/start_quickstart/), and you should also take a reinforcement learning course (this is a good place to start.)

Lastly, if you need to contact me, please do this only via email. Thanks.

12kobe commented 2 years ago

I'm sorry that I accidentally closed this question. I can only choose to use email to ask you questions. I hope you can see the email. Thank you!