Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

AttributeError: 'KitchenFrankaRandomDesk' object has no attribute 'reset_model' #28

Open
OOXXXXOO opened this issue Mar 15, 2023 · 2 comments

Comments

@OOXXXXOO
Copy link

run

python hydra_launcher.py hydra/launcher=local hydra/output=local env="kitchen_sdoor_open-v3" camera="left_cap2" pixel_based=true embedding=resnet50 num_demos=5 env_kwargs.load_path=r3m bc_kwargs.finetune=false proprio=9 job_name=r3m_repro seed=125

get output:

Traceback (most recent call last):
  File "/home/pi/workspace/tanwenxuan/Project/r3m/evaluation/r3meval/utils/gym_env.py", line 88, in reset
    return self.env.unwrapped.reset_model(seed=seed)
AttributeError: 'KitchenFrankaRandomDesk' object has no attribute 'reset_model'
@OOXXXXOO
Copy link
Author

r3m/evaluation/r3meval/utils/gym_env.py:

    def reset(self, seed=None):
        try:
            self.env._elapsed_steps = 0
            return self.env.unwrapped.reset_model(seed=seed)
        except:
            if seed is not None:
                self.set_seed(seed)
            return self.env.reset()

inference stack :

mj_envs/mj_envs/envs/relay_kitchen/kitchen_multitask_v2.py

class KitchenFrankaRandomDesk(KitchenFrankaFixed):
    def reset(self, reset_qpos=None, reset_qvel=None):
        if reset_qpos is None:
            reset_qpos = self.init_qpos.copy()
            reset_qpos[self.robot_dofs] += (
                0.05
                * (self.np_random.uniform(size=len(self.robot_dofs)) - 0.5)
                * (self.robot_ranges[:, 1] - self.robot_ranges[:, 0])
            )
            ncon = 10
            while ncon > 4:
                self.sim.model.body_pos[14] = np.array([-0.1, 0.75, 0.0]) + np.random.uniform(-0.1, 0.1, (3,))
                self.sim.step()
                ncon = self.sim.data.ncon
        return super().reset(reset_qpos=reset_qpos, reset_qvel=reset_qvel)

But KitchenFrankaRandomDesk Function don't have implement the 'reset_model' function

@OOXXXXOO
Copy link
Author

@suraj-nair-1 ???

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant