tmdt-buw / karolos

An Open-Source Reinforcement Learning Framework for Robot-Task Environments
MIT License
20 stars 0 forks source link

Visualisation of the simulator while RL agent is being trained & CUDA GPU acceleration support. #9

Open ChristosPeridis opened 1 year ago

ChristosPeridis commented 1 year ago

Hello dear Christian,

I hope you are doing well. Thank you very much for your immediate responses to the issues that I have opened the previous week. I have stared now exploring the karolos API and its capabilities. I wanted to ask is it possible to visualise the simulation of the robot while executing the task ? Furthermore, is it possible to accelerate the training procedure of the RL agent by leveraging powerful NVIDIA GPUs like NVIDIA RTX A5000 using CUDA acceleration in PyTorch?

Thank you very much in advance for all the valuable help and support!

Kind regards,

Christos Peridis

chrisbitter commented 1 year ago

Hey Christos,

yes and yes!

For visualization there are two cases:

  1. Make sure the training pipeline is working as intended. For this, the environment config needs to set the parameter render=True. Also, set number_processes=1, because Pybullet can only spawn one window:
    training_config = {
    "number_processes": 1,
    "env_config": {
    "render": True,
    }
    }
  2. Visualize a trained policy. Look at karolos/display.py and point it to the experiment folder. I just tested the file and found a little bug, so please pull the lastest version first.

Regarding cuda: The agent tries to use Cuda out of the box, see here: https://github.com/tmdt-buw/karolos/blob/1f277ce4a5ca34e3cd27dfb5cb361fcbd2df7a1c/karolos/agents/agent.py#L55 So if pytorch is installed correctly with cuda enabled, that should already work.

Hope that clears things up :) Let me know if you need anything else