Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'MemmapingPool' #240

Open
ioarun opened this issue Jul 25, 2018 · 8 comments
Open

ImportError: cannot import name 'MemmapingPool' #240

ioarun opened this issue Jul 25, 2018 · 8 comments

Comments

@ioarun
Copy link

ioarun commented Jul 25, 2018

Hi,

I am getting an error when running the examples:

Traceback (most recent call last): File "rllab/examples/trpo_cartpole.py", line 1, in <module> from rllab.algos.trpo import TRPO File "/home/arun/rbccps/rllab/rllab/algos/trpo.py", line 1, in <module> from rllab.algos.npo import NPO File "/home/arun/rbccps/rllab/rllab/algos/npo.py", line 3, in <module> from rllab.algos.batch_polopt import BatchPolopt File "/home/arun/rbccps/rllab/rllab/algos/batch_polopt.py", line 2, in <module> from rllab.sampler import parallel_sampler File "/home/arun/rbccps/rllab/rllab/sampler/parallel_sampler.py", line 2, in <module> from rllab.sampler.stateful_pool import singleton_pool, SharedGlobal File "/home/arun/rbccps/rllab/rllab/sampler/stateful_pool.py", line 3, in <module> from joblib.pool import MemmapingPool ImportError: cannot import name 'MemmapingPool'

I am running Ubuntu 16.04 and using Python3 to execute the scripts. Please help.
Thanks!

@AlexZhou1995
Copy link

AlexZhou1995 commented Jul 31, 2018

Just open rllab/sampler/stateful_pool.py and fix the typo.
from joblib.pool import MemmapingPool -> from joblib.pool import MemmappingPool

@BarelySentient
Copy link

Frustratingly, one of my machines (both are Ubuntu 18 and using python 2.7.15) works with Memmapping and another works with Memmaping (different number of p's). Is there a way to make both run successfully using synced files?

@AlexZhou1995
Copy link

@BarelySentient
I found that joblib==0.11 use Memmaping, while joblib=0.13 fixed this typo and use Memmapping.
I guess that one of your machines use 0.13 version and others use 0.11 version.

So you can try to use same version of joblib to solve the problem

@BarelySentient
Copy link

That helps a ton, thank you @AlexZhou1995 !!

@StuartFarmer
Copy link

This is terrible. I'd add this just to get around joblib's typo:

try:
    from joblib.pool import MemmapingPool as MemmappingPool
except:
    from joblib.pool import MemmappingPool

@GbengaOdesanmi
Copy link

@ALL please can you help me on how to solve this problem? thanks in advance

python maml_examples/maml_trpo_point.py
python3 /home/gbenga/Documents/2019vrepcode/maml_rl-master/maml_examples/scripts/run_experiment_lite.py --n_parallel '1' --snapshot_mode 'last' --seed '1' --plot 'False' --exp_name 'trpomaml1_fbs20_mbs40_flr_0.5metalr_0.01_step11' --log_dir '/home/gbenga/Documents/2019vrepcode/maml_rl-master/maml_examples/data/local/vpg-maml-point100/trpomaml1_fbs20_mbs40_flr_0.5metalr_0.01_step11' --use_cloudpickle 'False' --args_data 'gANjcmxsYWIubWlzYy5pbnN0cnVtZW50ClN0dWJNZXRob2RDYWxsCnEAKYFxAX1xAihYBgAAAF9fYXJnc3EDKGNybGxhYi5taXNjLmluc3RydW1lbnQKU3R1Yk9iamVjdApxBCmBcQV9cQYoWAQAAABhcmdzcQcpWAYAAABrd2FyZ3NxCH1xCShYAwAAAGVudnEKaAQpgXELfXEMKGgHKWgIfXENWAsAAAB3cmFwcGVkX2VudnEOaAQpgXEPfXEQKGgHKWgIfXERaApoBCmBcRJ9cRMoaAcpaAh9cRRYCwAAAHByb3h5X2NsYXNzcRVjcG9pbnRfZW52X3JhbmRnb2FsClBvaW50RW52UmFuZEdvYWwKcRZ1YnNoFWNybGxhYi5lbnZzLm5vcm1hbGl6ZWRfZW52Ck5vcm1hbGl6ZWRFbnYKcRd1YnNoFWNzYW5kYm94LnJvY2t5LnRmLmVudnMuYmFzZQpUZkVudgpxGHViWAYAAABwb2xpY3lxGWgEKYFxGn1xGyhoByloCH1xHChYBAAAAG5hbWVxHWgZWAgAAABlbnZfc3BlY3EeY3JsbGFiLm1pc2MuaW5zdHJ1bWVudApTdHViQXR0cgpxHymBcSB9cSEoWAQAAABfb2JqcSJoC1gKAAAAX2F0dHJfbmFtZXEjWAQAAABzcGVjcSR1YlgOAAAAZ3JhZF9zdGVwX3NpemVxJUc/4AAAAAAAAFgTAAAAaGlkZGVuX25vbmxpbmVhcml0eXEmY3RlbnNvcmZsb3cucHl0aG9uLm9wcy5nZW5fbm5fb3BzCnJlbHUKcSdYDAAAAGhpZGRlbl9zaXplc3EoS2RLZIZxKXVoFWNzYW5kYm94LnJvY2t5LnRmLnBvbGljaWVzLm1hbWxfbWluaW1hbF9nYXVzc19tbHBfcG9saWN5Ck1BTUxHYXVzc2lhbk1MUFBvbGljeQpxKnViWAgAAABiYXNlbGluZXEraAQpgXEsfXEtKGgHKWgIfXEuaB5oHymBcS99cTAoaCJoC2gjaCR1YnNoFWNybGxhYi5iYXNlbGluZXMubGluZWFyX2ZlYXR1cmVfYmFzZWxpbmUKTGluZWFyRmVhdHVyZUJhc2VsaW5lCnExdWJYCgAAAGJhdGNoX3NpemVxMksUWA8AAABtYXhfcGF0aF9sZW5ndGhxM0tkWA8AAABtZXRhX2JhdGNoX3NpemVxNEsoWBAAAABudW1fZ3JhZF91cGRhdGVzcTVLAVgFAAAAbl9pdHJxNktkWAgAAAB1c2VfbWFtbHE3iFgJAAAAc3RlcF9zaXplcThHP4R64UeuFHtYBAAAAHBsb3RxOYl1aBVjc2FuZGJveC5yb2NreS50Zi5hbGdvcy5tYW1sX3RycG8KTUFNTFRSUE8KcTp1YlgFAAAAdHJhaW5xOyl9cTx0cT1YCAAAAF9fa3dhcmdzcT59cT91Yi4='
python3: can't open file '/home/gbenga/Documents/2019vrepcode/maml_rl-master/maml_examples/scripts/run_experiment_lite.py': [Errno 2] No such file or directory

@kvas7andy
Copy link

@AlexZhou1995 thank you for workaround. Although no PR was proposed, so problem still exists.

@j3soon
Copy link

j3soon commented Nov 28, 2023

@kvas7andy, A PR seems to be proposed in #241.

j3soon added a commit to j3soon/haarnoja-softqlearning that referenced this issue Nov 28, 2023
Error message:

    using seed 3
    Traceback (most recent call last):
      File "/root/rllab/scripts/run_experiment_lite.py", line 137, in <module>
        run_experiment(sys.argv)
      File "/root/rllab/scripts/run_experiment_lite.py", line 74, in run_experiment
        from rllab.sampler import parallel_sampler
      File "/root/rllab/rllab/sampler/parallel_sampler.py", line 2, in <module>
        from rllab.sampler.stateful_pool import singleton_pool, SharedGlobal
      File "/root/rllab/rllab/sampler/stateful_pool.py", line 3, in <module>
        from joblib.pool import MemmapingPool
    ImportError: cannot import name 'MemmapingPool'

Reference: rll/rllab#240
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants