nicklashansen / tdmpc2

Code for "TD-MPC2: Scalable, Robust World Models for Continuous Control"
https://www.tdmpc2.com
MIT License
343 stars 71 forks source link

please verify that dependencies are installed and that the task exists. #31

Open 623637719 opened 4 months ago

623637719 commented 4 months ago

My computer system is macOS: I cloned your code to my local machine using git clone and installed the required dependencies. Then, I set hydra/launcher in config.yaml to basic. I noticed that there are predefined environments in envs/tasks, so I set the task in config.yaml to one of the existing filenames in envs/tasks, for example, hopper. However, when I run the script, I get the following error message:

Error executing job with overrides: []
Traceback (most recent call last):
File "/Users/zhengyehan/Desktop/TDMPC2/tdmpc2/tdmpc2/train.py", line 53, in train
env=make_env(cfg),
File "/Users/zhengyehan/Desktop/TDMPC2/tdmpc2/tdmpc2/envs/.init..py", line 71, in make_env
raise ValueError(f'Failed to make environment "{cfg.task}": please verify that dependencies are installed and that the task exists.')
ValueError: Failed to make environment "hopper": please verify that dependencies are installed and that the task exists.
Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.

Could you please help me solve this issue? Thank you!

mpont commented 4 months ago

I had the same problem, I ended up booting up Ubuntu and using the Docker Linux container provided since I'm pretty sure this problem has to do with the fact that libraries such as sapien are required by the wrappers that create environments, while they don't have Windows- or macOS-compatible distributions.

nicklashansen commented 3 months ago

I have not tested the codebase on macOS so I'm not sure what the potential issues might be, but I second what @mpont said re: using a linux environment. As an aside, please double-check that the task does indeed exist, e.g., cfg.task=hopper-hop is a valid task but cfg.task=hopper is not.

anh-nn01 commented 2 months ago

I also encountered this issue for Meta-World envs, although it ran without any problem for DMControl tasks.

In my case, the issue was cause by the imports in envs/__init__.py

try:
    from envs.metaworld import make_env as make_metaworld_env
except:
    make_metaworld_env = missing_dependencies

The error causing the issue was [Errno 2] No such file or directory: 'patchelf', which can be solved by sudo apt-get install patchelf. If you are using server without sudo permission to install patchelf, you can create a conda env instead.

Since the code uses exception handling, it does not pinpoint the exact problem, so I had to manually trace it down. You can start by tracing the error from envs/__init__.py.