Code Monkey home page Code Monkey logo

Comments (3)

gauthamvasan avatar gauthamvasan commented on June 4, 2024

Hi @fisherxue, we had a similar discussion in this issue. Please look at the entire discussion and try the steps listed there. If you're still running into issues, let me know.

from senseact.

fisherxue avatar fisherxue commented on June 4, 2024

What I've done: saved the random state in a file, then loaded it using pickle. I do this before the env is loaded. I then set the tensorflow random seed and the python random seed after sess.enter()

I am also passing the random state I load from file into the environment.
I'm fairly sure my hardware is not the bottleneck.

I am able to get relatively consistent results when I run two simulations at the same time. However, when I run one after the other, I get vastly different results. Any advice?

This is what I have:

# use fixed random state
with open('random.obj', 'rb') as f:
    rand_state = pickle.load(f)
np.random.set_state(rand_state)
tf_set_seeds(np.random.randint(1, 2**31 - 1))

#Create Asynchronous Simulation of InvertedDoublePendulum-v2 mujoco environment.
env = DoubleInvertedPendulumEnv(agent_dt=0.005,
                                sensor_dt=[0.01, 0.0033333],
                                is_render=False,
                                random_state=rand_state
                               )
# Start environment processes
env.start()

# Create baselines ppo policy function
sess = U.single_threaded_session()
sess.__enter__()
seed = np.random.randint(1, 2**31 - 1)
tf.set_random_seed(seed)
random.seed(seed)

Thanks!

from senseact.

fisherxue avatar fisherxue commented on June 4, 2024

@gauthamvasan
I'm getting this warning when running on one machine:
WARNING:root:Agent has over-run its allocated dt, it has been 0.008300065994262695 since the last observation, 0.003300065994262695 more than allowed
However, on the other machine I'm running it on, I only get that warning at the start of each iteration.
I'm still failing to get tight repeatability curves on double pendulum.

Any tips?
Thanks!

from senseact.

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.