Skip to content

Commit

Permalink
Update gym_env.py
Browse files Browse the repository at this point in the history
  • Loading branch information
SijingYu authored Dec 2, 2023
1 parent 383f99c commit 983f6b0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions rllab/envs/gym_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
import logging

try:
from gym.wrappers.monitoring import logger as monitor_logger

# from gym.wrappers.monitoring import logger as monitor_logger
# import gym.wrappers.logger as monitor_logger
import gym.logger as monitor_logger
monitor_logger.setLevel(logging.WARNING)
except Exception as e:
traceback.print_exc()
Expand All @@ -19,7 +20,8 @@
from rllab.spaces.box import Box
from rllab.spaces.discrete import Discrete
from rllab.spaces.product import Product
from rllab.misc import logger
# from rllab.misc import logger
import rllab.misc.logger as logger


def convert_gym_space(space):
Expand Down Expand Up @@ -56,7 +58,7 @@ def __call__(self, count):


class GymEnv(Env, Serializable):
def __init__(self, env_name, record_video=True, video_schedule=None, log_dir=None, record_log=True,
def __init__(self, env_name, record_video=True, video_schedule=None, log_dir=None, record_log=False,
force_reset=False):
if log_dir is None:
if logger.get_snapshot_dir() is None:
Expand All @@ -69,7 +71,7 @@ def __init__(self, env_name, record_video=True, video_schedule=None, log_dir=Non
self.env = env
self.env_id = env.spec.id

assert not (not record_log and record_video)
# assert not (not record_log and record_video)x

if log_dir is None or record_log is False:
self.monitoring = False
Expand Down

0 comments on commit 983f6b0

Please sign in to comment.