Fix CloudpickleWrapper load (#118)

* CloudpickleWrapper: Load using cloudpickle

* Update changelog
This commit is contained in:
Steven H. Wang 2020-07-21 01:12:39 -07:00 committed by GitHub
parent 41b66e33ce
commit 83530560b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -30,6 +30,7 @@ Bug Fixes:
^^^^^^^^^^ ^^^^^^^^^^
- Fixed a bug in the ``close()`` method of ``SubprocVecEnv``, causing wrappers further down in the wrapper stack to not be closed. (@NeoExtended) - Fixed a bug in the ``close()`` method of ``SubprocVecEnv``, causing wrappers further down in the wrapper stack to not be closed. (@NeoExtended)
- Fix target for updating q values in SAC: the entropy term was not conditioned by terminals states - Fix target for updating q values in SAC: the entropy term was not conditioned by terminals states
- Use ``cloudpickle.load`` instead of ``pickle.load`` in ``CloudpickleWrapper``. (@shwang)
Deprecations: Deprecations:
^^^^^^^^^^^^^ ^^^^^^^^^^^^^
@ -355,4 +356,4 @@ And all the contributors:
@Miffyli @dwiel @miguelrass @qxcv @jaberkow @eavelardev @ruifeng96150 @pedrohbtp @srivatsankrishnan @evilsocket @Miffyli @dwiel @miguelrass @qxcv @jaberkow @eavelardev @ruifeng96150 @pedrohbtp @srivatsankrishnan @evilsocket
@MarvineGothic @jdossgollin @SyllogismRXS @rusu24edward @jbulow @Antymon @seheevic @justinkterry @edbeeching @MarvineGothic @jdossgollin @SyllogismRXS @rusu24edward @jbulow @Antymon @seheevic @justinkterry @edbeeching
@flodorner @KuKuXia @NeoExtended @PartiallyTyped @mmcenta @richardwu @kinalmehta @rolandgvc @tkelestemur @mloo3 @flodorner @KuKuXia @NeoExtended @PartiallyTyped @mmcenta @richardwu @kinalmehta @rolandgvc @tkelestemur @mloo3
@tirafesi @blurLake @koulakis @joeljosephjin @tirafesi @blurLake @koulakis @joeljosephjin @shwang

View file

@ -1,5 +1,4 @@
import inspect import inspect
import pickle
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from typing import List, Optional, Sequence, Union from typing import List, Optional, Sequence, Union
@ -349,7 +348,7 @@ class VecEnvWrapper(VecEnv):
return shadowed_wrapper_class return shadowed_wrapper_class
class CloudpickleWrapper(object): class CloudpickleWrapper:
def __init__(self, var): def __init__(self, var):
""" """
Uses cloudpickle to serialize contents (otherwise multiprocessing tries to use pickle) Uses cloudpickle to serialize contents (otherwise multiprocessing tries to use pickle)
@ -362,4 +361,4 @@ class CloudpickleWrapper(object):
return cloudpickle.dumps(self.var) return cloudpickle.dumps(self.var)
def __setstate__(self, obs): def __setstate__(self, obs):
self.var = pickle.loads(obs) self.var = cloudpickle.loads(obs)