From e499da08dffcfb2106d8e66951061270a1fd18e7 Mon Sep 17 00:00:00 2001 From: Bart Moyaers Date: Thu, 8 Aug 2019 16:03:48 +0200 Subject: [PATCH] correct pickle loading --- .../gym/pybullet_envs/deep_mimic/mocap/h36m_dataset.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/pybullet/gym/pybullet_envs/deep_mimic/mocap/h36m_dataset.py b/examples/pybullet/gym/pybullet_envs/deep_mimic/mocap/h36m_dataset.py index 9dd95f902..d35287c47 100644 --- a/examples/pybullet/gym/pybullet_envs/deep_mimic/mocap/h36m_dataset.py +++ b/examples/pybullet/gym/pybullet_envs/deep_mimic/mocap/h36m_dataset.py @@ -282,9 +282,18 @@ class Human36mDataset(MocapDataset): cam['intrinsic'] = np.concatenate((cam['focal_length'], cam['center'], cam['radial_distortion'], cam['tangential_distortion'])) + # save np.load + np_load_old = np.load + + # modify the default parameters of np.load + np.load = lambda *a,**k: np_load_old(*a, allow_pickle=True, **k) + # Load serialized dataset data = np.load(path)['positions_3d'].item() + # restore np.load for future normal usage + np.load = np_load_old + self._data = {} for subject, actions in data.items(): self._data[subject] = {}