示例#1
0
 def reset(self):
     if self.waiting_step:
         logger.warn('Called reset() while waiting for the step to complete')
         self.step_wait()
     for pipe in self.parent_pipes:
         pipe.send(('reset', None))
     return self._decode_obses([pipe.recv() for pipe in self.parent_pipes])
示例#2
0
def load_state(fname, sess=None):
    from openai_baselines import logger
    logger.warn(
        'load_state method is deprecated, please use load_variables instead')
    sess = sess or get_session()
    saver = tf.train.Saver()
    saver.restore(tf.get_default_session(), fname)
示例#3
0
def save_state(fname, sess=None):
    from openai_baselines import logger
    logger.warn(
        'save_state method is deprecated, please use save_variables instead')
    sess = sess or get_session()
    dirname = os.path.dirname(fname)
    if any(dirname):
        os.makedirs(dirname, exist_ok=True)
    saver = tf.train.Saver()
    saver.save(tf.get_default_session(), fname)
示例#4
0
 def render(self, mode='human'):
     logger.warn('Render not defined for %s' % self)