younggyoseo / MWM

Masked World Models for Visual Control
Other
116 stars 9 forks source link

Can not make two RL Bench enviroments #3

Closed qiwang067 closed 1 year ago

qiwang067 commented 1 year ago

Hi Younggyo, I tried to make two RL Bench environments by MWM code, but these errors occurs :

   train_envs = [make_async_env("train") for _ in range(config.envs)]
  File "dreamer.py", line 285, in <listcomp>
    train_envs = [make_async_env("train") for _ in range(config.envs)]
  File "dreamer.py", line 283, in <lambda>
    functools.partial(make, mode), config.envs_parallel
  File "/home/ubuntu/pywork/dreamer-torch/wrappers.py", line 710, in __init__
    self._pickled_ctor = cloudpickle.dumps(constructor)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/site-packages/cloudpickle/cloudpickle_fast.py", line 102, in dumps
    cp.dump(obj)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/site-packages/cloudpickle/cloudpickle_fast.py", line 563, in dump
    return Pickler.dump(self, obj)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 437, in dump
    self.save(obj)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 549, in save
    self.save_reduce(obj=obj, *rv)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 638, in save_reduce
    save(args)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 504, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 774, in save_tuple
    save(element)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 504, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/site-packages/cloudpickle/cloudpickle_fast.py", line 745, in save_function
    *self._dynamic_function_reduce(obj), obj=obj
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/site-packages/cloudpickle/cloudpickle_fast.py", line 687, in _save_reduce_pickle5
    save(state)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 504, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 774, in save_tuple
    save(element)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 504, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 859, in save_dict
    self._batch_setitems(obj.items())
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 885, in _batch_setitems
    save(v)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 504, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 789, in save_tuple
    save(element)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 549, in save
    self.save_reduce(obj=obj, *rv)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 638, in save_reduce
    save(args)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 504, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 774, in save_tuple
    save(element)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 549, in save
    self.save_reduce(obj=obj, *rv)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 662, in save_reduce
    save(state)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 504, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 859, in save_dict
    self._batch_setitems(obj.items())
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 885, in _batch_setitems
    save(v)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 549, in save
    self.save_reduce(obj=obj, *rv)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 662, in save_reduce
    save(state)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 504, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 859, in save_dict
    self._batch_setitems(obj.items())
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 885, in _batch_setitems
    save(v)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 549, in save
    self.save_reduce(obj=obj, *rv)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 662, in save_reduce
    save(state)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 504, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 859, in save_dict
    self._batch_setitems(obj.items())
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 890, in _batch_setitems
    save(v)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 549, in save
    self.save_reduce(obj=obj, *rv)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 662, in save_reduce
    save(state)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 504, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 859, in save_dict
    self._batch_setitems(obj.items())
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 885, in _batch_setitems
    save(v)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 549, in save
    self.save_reduce(obj=obj, *rv)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 662, in save_reduce
    save(state)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 504, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 859, in save_dict
    self._batch_setitems(obj.items())
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 885, in _batch_setitems
    save(v)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 549, in save
    self.save_reduce(obj=obj, *rv)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 662, in save_reduce
    save(state)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 504, in save
    f(self, obj) # Call unbound method with explicit self
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 859, in save_dict
    self._batch_setitems(obj.items())
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 885, in _batch_setitems
    save(v)
  File "/home/ubuntu/anaconda3/envs/dreamer/lib/python3.7/pickle.py", line 524, in save
    rv = reduce(self.proto)
TypeError: can't pickle _thread.lock objects
younggyoseo commented 1 year ago

Hi Qi, could you have a look at our more recent MV-MWM implementation (https://github.com/younggyoseo/MV-MWM)? We don't support parallel environments in MWM codebase. Thanks!

qiwang067 commented 1 year ago

Hi Qi, could you have a look at our more recent MV-MWM implementation (https://github.com/younggyoseo/MV-MWM)? We don't support parallel environments in MWM codebase. Thanks!

Hi Younggyo, thank you for taking the time to address my query. I will try the code you provided and see if it resolves the issue.