facebookresearch / mtrl

Multi Task RL Baselines
MIT License
223 stars 28 forks source link

Task version issue while running CARE baseline #10

Closed americast closed 2 years ago

americast commented 2 years ago

Description

When I try to run the CARE baseline, the code automatically takes version 2 of each task. Since the embeddings are available for version 1 of the tasks, it leads to an error. However, a simple hard replacement of "2" with "1" inside the code helps fix the issue. But I am not sure why version 2 of every task is being invoked by default, and if it is the correct way to fix the issue.

How to reproduce

Just running the CARE baseline leads to this issue.

Stack trace / error message

hydra.errors.HydraException: Error calling 'mtrl.experiment.metaworld.Experiment' : Error calling 'mtrl.agent.sac.Agent' : Error calling 'mtrl.agent.components.task_encoder.TaskEncoder' : 'reach-v2

System information

Any other information

A quick fix for this problem is changing https://github.com/facebookresearch/mtrl/blob/main/mtrl/agent/components/task_encoder.py#L42-L44 to

pretrained_embedding = torch.Tensor(
     [metadata[task[:-1]+"1"] for task in ordered_task_list]
)

Any leads in this regard would be very helpful. Thank you!

shagunsodhani commented 2 years ago

Hey @americast ! Thank you for your question. I apologize for the late reply as I am travelling currently.

When I try to run the CARE baseline, the code automatically takes version 2 of each task.

The code is written to work with version 1 of MetaWorld. I have not followed closely with the development of MetaWorld V2 but I think reward functions have changed and state/action dims etc are different as well. So what you observed seems valid.

But I am not sure why version 2 of every task is being invoked by default,

I am not sure but it could be because when we invoke something like metaworld.MT10, it invokes the V2 environments.

and if it is the correct way to fix the issue.

I am not sure if this is the right way given that I have not followed closely with the development of MetaWorld V2. One other way would be specifically install MetaWorld V1 using git commit ids.

shagunsodhani commented 2 years ago

Hey @americast! I hope your issue was resolved. I am closing the issue for now. Feel free to add more details.