File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 7
7
import numpy as np
8
8
from copy import deepcopy
9
9
10
- import mujoco_py
11
10
import robosuite
12
11
13
12
import robomimic .utils .obs_utils as ObsUtils
14
13
import robomimic .envs .env_base as EB
15
14
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
+
16
22
17
23
class EnvRobosuite (EB .EnvBase ):
18
24
"""Wrapper class for robosuite environments (https://github.com/ARISE-Initiative/robosuite)"""
@@ -375,7 +381,7 @@ def rollout_exceptions(self):
375
381
that the entire training run doesn't crash because of a bad policy that causes unstable
376
382
simulation computations.
377
383
"""
378
- return ( mujoco_py . builder . MujocoException )
384
+ return tuple ( MUJOCO_EXCEPTIONS )
379
385
380
386
def __repr__ (self ):
381
387
"""
You can’t perform that action at this time.
0 commit comments