Skip to content

Commit a4c0728

Browse files
committed
Catch exception when unable to load ROMs.
PiperOrigin-RevId: 827426008
1 parent 65fda2c commit a4c0728

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

dopamine/discrete_domains/atari_lib.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,17 @@ def create_atari_environment(
126126
if continuous_action_threshold is None
127127
else continuous_action_threshold
128128
)
129-
env = gym.make(
130-
full_game_name,
131-
repeat_action_probability=repeat_action_probability,
132-
frameskip=1,
133-
max_num_frames_per_episode=100_000,
134-
continuous=continuous,
135-
continuous_action_threshold=continuous_action_threshold,
136-
)
129+
try:
130+
env = gym.make(
131+
full_game_name,
132+
repeat_action_probability=repeat_action_probability,
133+
frameskip=1,
134+
max_num_frames_per_episode=100_000,
135+
continuous=continuous,
136+
continuous_action_threshold=continuous_action_threshold,
137+
)
138+
except Exception: # pylint: disable=broad-exception-caught
139+
logging.fatal('Unable to open ROMs.')
137140

138141
if use_ppo_preprocessing:
139142
env = atari_wrappers.NoopResetEnv(env, noop_max=30)

0 commit comments

Comments
 (0)