File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77import numpy as np
88from copy import deepcopy
99
10- import mujoco_py
1110import robosuite
1211
1312import robomimic .utils .obs_utils as ObsUtils
1413import robomimic .envs .env_base as EB
1514
15+ # protect against missing mujoco-py module, since robosuite might be using mujoco-py or DM backend
16+ try :
17+ import mujoco_py
18+ MUJOCO_EXCEPTIONS = [mujoco_py .builder .MujocoException ]
19+ except ImportError :
20+ MUJOCO_EXCEPTIONS = []
21+
1622
1723class EnvRobosuite (EB .EnvBase ):
1824 """Wrapper class for robosuite environments (https://github.com/ARISE-Initiative/robosuite)"""
@@ -375,7 +381,7 @@ def rollout_exceptions(self):
375381 that the entire training run doesn't crash because of a bad policy that causes unstable
376382 simulation computations.
377383 """
378- return ( mujoco_py . builder . MujocoException )
384+ return tuple ( MUJOCO_EXCEPTIONS )
379385
380386 def __repr__ (self ):
381387 """
You can’t perform that action at this time.
0 commit comments