ravens/agents/gt_state_2_step.py
def load(self, num_iter):
        """Load in a similar fashion as the 1-step GT agent."""
        pick_fname  = 'gt-state-2-step-pick-ckpt-%d' % num_iter
        place_fname = 'gt-state-2-step-place-ckpt-%d' % num_iter
        pick_fname  = os.path.join(self.models_dir, pick_fname)
        place_fname = os.path.join(self.models_dir, place_fname)
        self.pick_model  = keras.models.load_model(pick_fname, compile=False)
        self.place_model = keras.models.load_model(place_fname, compile=False)
        self.total_iter = num_iter

        # Load other data we need for proper usage of the model.
        data_fname = os.path.join(self.models_dir, 'misc_data.pkl')
        with open(data_fname, 'rb') as fh:
            data = pickle.load(fh)
        self.max_obs_vector_length = data['max_obs_vector_length']

        # Note: we cannot call self.model methods directly, other than __call__.
        # Actually, I'm not even sure if this works, but we don't normalize
        # with the current model. TODO(daniel) does this work?
        self.pick_model.obs_train_mean  = data['pick_obs_train_mean']
        self.place_model.obs_train_mean = data['place_obs_train_mean']
        self.pick_model.obs_train_std   = data['pick_obs_train_std']
        self.place_model.obs_train_std  = data['place_obs_train_std']
Load in a similar fashion as the 1-step GT agent.
Load in a similar fashion as the 1-step GT agent.
Load in a similar fashion as the 1 - step GT agent .
def load(self, num_iter):
        pick_fname  = 'gt-state-2-step-pick-ckpt-%d' % num_iter
        place_fname = 'gt-state-2-step-place-ckpt-%d' % num_iter
        pick_fname  = os.path.join(self.models_dir, pick_fname)
        place_fname = os.path.join(self.models_dir, place_fname)
        self.pick_model  = keras.models.load_model(pick_fname, compile=False)
        self.place_model = keras.models.load_model(place_fname, compile=False)
        self.total_iter = num_iter
        data_fname = os.path.join(self.models_dir, 'misc_data.pkl')
        with open(data_fname, 'rb') as fh:
            data = pickle.load(fh)
        self.max_obs_vector_length = data['max_obs_vector_length']
        self.pick_model.obs_train_mean  = data['pick_obs_train_mean']
        self.place_model.obs_train_mean = data['place_obs_train_mean']
        self.pick_model.obs_train_std   = data['pick_obs_train_std']
        self.place_model.obs_train_std  = data['place_obs_train_std']
def load ( self , num_iter ) : pick_fname = 'gt-state-2-step-pick-ckpt-%d' % num_iter place_fname = 'gt-state-2-step-place-ckpt-%d' % num_iter pick_fname = os . path . join ( self . models_dir , pick_fname ) place_fname = os . path . join ( self . models_dir , place_fname ) self . pick_model = keras . models . load_model ( pick_fname , compile = False ) self . place_model = keras . models . load_model ( place_fname , compile = False ) self . total_iter = num_iter data_fname = os . path . join ( self . models_dir , 'misc_data.pkl' ) with open ( data_fname , 'rb' ) as fh : data = pickle . load ( fh ) self . max_obs_vector_length = data [ 'max_obs_vector_length' ] self . pick_model . obs_train_mean = data [ 'pick_obs_train_mean' ] self . place_model . obs_train_mean = data [ 'place_obs_train_mean' ] self . pick_model . obs_train_std = data [ 'pick_obs_train_std' ] self . place_model . obs_train_std = data [ 'place_obs_train_std' ]
Load in a similar fashion as the 1-step GT agent.
Load in a similar fashion as the 1 - step GT agent .
"""Load in a similar fashion as the 1-step GT agent.""" # Load other data we need for proper usage of the model. # Note: we cannot call self.model methods directly, other than __call__. # Actually, I'm not even sure if this works, but we don't normalize # with the current model. TODO(daniel) does this work?
self
num_iter