Giter VIP home page Giter VIP logo

Comments (10)

dementrock avatar dementrock commented on August 29, 2024

This is really weird. Can you try launching the script and then cancel it, to get a stack trace of where it's stuck? Also, can you try running the non-stub version trpo_cartpole.py to see if it works?

from rllab.

garymcintire avatar garymcintire commented on August 29, 2024

Yes, non-stub version works great
control-C is shown below. I did it 3 times and one process was always at the same place subprocess.py", line 476, in _eintr_retry_call.
The other process is at instrument.py", line 28, in getitem

Way below you can see the result of ps -opid,ppid,pcpu,%mem,args -e | grep python
It prints the PID, PPID, %cpu, %mem command
Note that the grandchild process is at 77% memory usage. It uses quite a bit of CPU while its parent and grandparent use almost no CPU.

Its much more view-able in a larger window

(rllab)gary@gary-ubuntu:/rllab-master/examples$ python trpo_cartpole_stub.py
/home/gary/anaconda/envs/rllab/lib/python2.7/site-packages/theano/tensor/signal/downsample.py:6: UserWarning: downsample module has been moved to the theano.tensor.signal.pool module.
"downsample module has been moved to the theano.tensor.signal.pool module.")
python /home/gary/rllab-master/scripts/run_experiment_lite.py --n_parallel '1' --seed '1' --log_dir '/home/gary/rllab-master/data/local/experiment/experiment_2016_05_20_19_38_42_0001' --snapshot_mode 'last' --exp_name 'experiment_2016_05_20_19_38_42_0001' --args_data 'Y2NvcHlfcmVnCl9yZWNvbnN0cnVjdG9yCnAxCihjcmxsYWIubWlzYy5pbnN0cnVtZW50ClN0dWJNZXRob2RDYWxsCnAyCmNfX2J1aWx0aW5fXwpvYmplY3QKcDMKTnRScDQKKGRwNQpTJ19fYXJncycKcDYKZzEKKGNybGxhYi5taXNjLmluc3RydW1lbnQKU3R1YkF0dHIKcDcKZzMKTnRScDgKKGRwOQpTJ19vYmonCnAxMApnNApzUydfYXR0cl9uYW1lJwpwMTEKUydfU2VyaWFsaXphYmxlX19hcmdzJwpwMTIKc2JzUydfX2t3YXJncycKcDEzCmcxCihnNwpnMwpOdFJwMTQKKGRwMTUKZzEwCmc0CnNnMTEKUydfU2VyaWFsaXphYmxlX19rd2FyZ3MnCnAxNgpzYnNiLg=='
/home/gary/anaconda/envs/rllab/lib/python2.7/site-packages/theano/tensor/signal/downsample.py:6: UserWarning: downsample module has been moved to the theano.tensor.signal.pool module.
"downsample module has been moved to the theano.tensor.signal.pool module.")
using seed 1
using seed 1
^CTraceback (most recent call last):
File "trpo_cartpole_stub.py", line 41, in
seed=1,
File "/home/gary/rllab-master/rllab/misc/instrument.py", line 354, in run_experiment_lite
subprocess.call(command, shell=True, env=dict(os.environ, *_env))
File "/home/gary/anaconda/envs/rllab/lib/python2.7/subprocess.py", line 522, in call
return Popen(_popenargs, *_kwargs).wait()
File "/home/gary/anaconda/envs/rllab/lib/python2.7/subprocess.py", line 1384, in wait
pid, sts = _eintr_retry_call(os.waitpid, self.pid, 0)
File "/home/gary/anaconda/envs/rllab/lib/python2.7/subprocess.py", line 476, in _eintr_retry_call
return func(_args)
KeyboardInterrupt
(rllab)gary@gary-ubuntu:
/rllab-master/examples$ Traceback (most recent call last):
File "/home/gary/rllab-master/scripts/run_experiment_lite.py", line 107, in
run_experiment(sys.argv)
File "/home/gary/rllab-master/scripts/run_experiment_lite.py", line 75, in run_experiment
data = pickle.loads(base64.b64decode(args.args_data))
File "/home/gary/rllab-master/rllab/core/serializable.py", line 32, in setstate
out = type(self)(_d["__args"], *_d["kwargs"])
File "/home/gary/rllab-master/rllab/misc/instrument.py", line 28, in __getitem

return StubMethodCall(self, "getitem", args=[item], kwargs=dict())
KeyboardInterrupt

The command below prints the PID, PPID, %cpu, %mem command-w-args
gary@gary-ubuntu:/bin$ ps -opid,ppid,pcpu,%mem,args -e | grep python
11104 4650 0.6 0.0 python trpo_cartpole_stub.py
11118 11104 0.0 0.0 /bin/sh -c python /home/gary/rllab-master/scripts/run_experiment_lite.py --n_parallel '1' --seed '1' --log_dir '/home/gary/rllab-master/data/local/experiment/experiment_2016_05_20_19_20_42_0001' --snapshot_mode 'last' --exp_name 'experiment_2016_05_20_19_20_42_0001' --args_data 'Y2NvcHlfcmVnCl9yZWNvbnN0cnVjdG9yCnAxCihjcmxsYWIubWlzYy5pbnN0cnVtZW50ClN0dWJNZXRob2RDYWxsCnAyCmNfX2J1aWx0aW5fXwpvYmplY3QKcDMKTnRScDQKKGRwNQpTJ19fYXJncycKcDYKZzEKKGNybGxhYi5taXNjLmluc3RydW1lbnQKU3R1YkF0dHIKcDcKZzMKTnRScDgKKGRwOQpTJ19vYmonCnAxMApnNApzUydfYXR0cl9uYW1lJwpwMTEKUydfU2VyaWFsaXphYmxlX19hcmdzJwpwMTIKc2JzUydfX2t3YXJncycKcDEzCmcxCihnNwpnMwpOdFJwMTQKKGRwMTUKZzEwCmc0CnNnMTEKUydfU2VyaWFsaXphYmxlX19rd2FyZ3MnCnAxNgpzYnNiLg=='
11119 11118 35.1 77.6 python /home/gary/rllab-master/scripts/run_experiment_lite.py --n_parallel 1 --seed 1 --log_dir /home/gary/rllab-master/data/local/experiment/experiment_2016_05_20_19_20_42_0001 --snapshot_mode last --exp_name experiment_2016_05_20_19_20_42_0001 --args_data Y2NvcHlfcmVnCl9yZWNvbnN0cnVjdG9yCnAxCihjcmxsYWIubWlzYy5pbnN0cnVtZW50ClN0dWJNZXRob2RDYWxsCnAyCmNfX2J1aWx0aW5fXwpvYmplY3QKcDMKTnRScDQKKGRwNQpTJ19fYXJncycKcDYKZzEKKGNybGxhYi5taXNjLmluc3RydW1lbnQKU3R1YkF0dHIKcDcKZzMKTnRScDgKKGRwOQpTJ19vYmonCnAxMApnNApzUydfYXR0cl9uYW1lJwpwMTEKUydfU2VyaWFsaXphYmxlX19hcmdzJwpwMTIKc2JzUydfX2t3YXJncycKcDEzCmcxCihnNwpnMwpOdFJwMTQKKGRwMTUKZzEwCmc0CnNnMTEKUydfU2VyaWFsaXphYmxlX19rd2FyZ3MnCnAxNgpzYnNiLg==
gary@gary-ubuntu:
/bin$

from rllab.

garymcintire avatar garymcintire commented on August 29, 2024

Correction. Both processes were in the same place all 3 times I tried it

from rllab.

dementrock avatar dementrock commented on August 29, 2024

Can you paste the content of your trpo_cartpole_stub file? I could reproduce the issue using the exact base64-encoded command you provided, but not if I run the script directly. Knowing the file content will help me a bit

from rllab.

garymcintire avatar garymcintire commented on August 29, 2024

This is it. I downloaded it about a week ago

from rllab.algos.trpo import TRPO
from rllab.baselines.linear_feature_baseline import LinearFeatureBaseline
from rllab.envs.box2d.cartpole_env import CartpoleEnv
from rllab.envs.normalized_env import normalize
from rllab.misc.instrument import stub, run_experiment_lite
from rllab.policies.gaussian_mlp_policy import GaussianMLPPolicy

stub(globals())

env = normalize(CartpoleEnv())

policy = GaussianMLPPolicy(
env_spec=env.spec,
# The neural network policy should have two hidden layers, each with 32 hidden units.
hidden_sizes=(32, 32)
)

baseline = LinearFeatureBaseline(env_spec=env.spec)

algo = TRPO(
env=env,
policy=policy,
baseline=baseline,
batch_size=4000,
max_path_length=100,
n_itr=40,
discount=0.99,
step_size=0.01,
# Uncomment both lines (this and the plot parameter below) to enable plotting
# plot=True,
)

run_experiment_lite(
algo.train(),
# Number of parallel workers for sampling
n_parallel=1,
# Only keep the snapshot parameters for the last iteration
snapshot_mode="last",
# Specifies the seed for the experiment. If this is not provided, a random seed
# will be used
seed=1,
# plot=True,
)

from rllab.

dementrock avatar dementrock commented on August 29, 2024

Can you try using the latest commit on master? Or can you give me the commit that your local copy corresponds to? This would be the result of running git rev-parse HEAD in the repo folder.

from rllab.

garymcintire avatar garymcintire commented on August 29, 2024

I just cloned the latest master and have the same problem.

My friend also has the exact same problem on his macbook pro. I'm on ubuntu

I'm guessing its a cPickle issue, but I tried replacing the cPickle imports with 'import pickle' in the two files where its pickled and then unpickled and it still didn't work.

Since you mentioned you could reproduce the issue when just executing the command line of mine, it would seem the string is not pickled correctly in the first place.

Is your pickled arg_data string(when it works for you) the same as mine?

from rllab.

dementrock avatar dementrock commented on August 29, 2024

Ah, found it! I couldn't reproduce it using the script because I had two local copies of rllab. I forgot to commit some file updates to the public version. You can try to pull from master again and it should be fixed now.

from rllab.

garymcintire avatar garymcintire commented on August 29, 2024

You rock!!!

cartpole screams with 20 processes on my 24 core machine!

from rllab.

dementrock avatar dementrock commented on August 29, 2024

Awesome!

from rllab.

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.