Giter Club home page Giter Club logo

Comments (3)

araffin avatar araffin commented on June 26, 2024

Hello,
if you want to parallelize gradient steps, you need to have a look at Stable-Baselines-Team/stable-baselines3-contrib#11 and linked issues.
if you want to parallelize data collection, you need to use VecEnv.

I'm also not sure why you have some TF code in there...

from stable-baselines3.

n-kish avatar n-kish commented on June 26, 2024

Hi @araffin, thanks for your response.

I may have not been quite clear about what I wanted to achieve.

I am parallelizing external to the model instance and not within it. That is, with each different XML file, I run a train_ppo.py instance per thread. Depending on the XML file count, the number of parallel processes increases, and thus gym envs. are created and PPO models are trained in parallel. It is here I face the problem.

I notice that the gradient steps are somehow taking longer and longer to process with the increase in the thread count (i.e. increase in independent gym env count), which normally shouldn't be the case because each thread must be treated independently and I should have models trained independently. (Please notice the time_elapsed in seconds for just 4000 env. steps in the attached screenshot)

Screenshot from 2024-05-23 13-25-58

Hence your suggestions about parallel gradient steps and data collection through Stable-Baselines-Team/stable-baselines3-contrib/issues/11 and VecEnv, though useful, aren't addressing my problem, because I still have num_cpu=1 even in VecEnv.

Hope this clarifies things further. Please let me know how I may go about this problem, thanks.

And yes, the TF code is a blunder please ignore it.

from stable-baselines3.

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.