Closed CRLqinliang closed 1 year ago
@jannerm
Recent changes to dependencies (and ownership) of d4rl might have broken the installation even though it is version-locked. Try installing the version of d4rl here, which I believe is still actively maintained.
@jannerm I tried to download the d4rl which you said by:
pip install d4rl -f https://github.com/Farama-Foundation/d4rl@f2a05c0d66722499bf8031b094d9af3aea7c372b#egg=d4rl
It still does not work. By the way, I realized that the link which you answered me is the same as the one in the previous environment.yml file.
From this message:
Warning: Mujoco-based envs failed to import. Set the environment variable D4RL_SUPPRESS_IMPORT_ERROR=1 to suppress this message.
No module named 'mjrl'
It sounds like you are missing the dependencies of d4rl. What is the output from your pip installation?
@jannerm Well, after running the pip install command, it showed that everything had already been satisfied.
pip install d4rl -f https://github.com/Farama-Foundation/d4rl@f2a05c0d66722499bf8031b094d9af3aea7c372b#egg=d4rl
Looking in links: https://github.com/Farama-Foundation/d4rl@f2a05c0d66722499bf8031b094d9af3aea7c372b#egg=d4rl
Requirement already satisfied: d4rl in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (1.1)
Requirement already satisfied: dm-control>=1.0.3 in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from d4rl) (1.0.9)
Requirement already satisfied: mujoco-py in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from d4rl) (2.1.2.14)
Requirement already satisfied: pybullet in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from d4rl) (3.2.5)
Requirement already satisfied: termcolor in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from d4rl) (2.1.1)
Requirement already satisfied: numpy in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from d4rl) (1.23.5)
Requirement already satisfied: gym<0.25.0 in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from d4rl) (0.18.0)
Requirement already satisfied: click in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from d4rl) (8.1.3)
Requirement already satisfied: h5py in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from d4rl) (3.7.0)
Requirement already satisfied: pyopengl>=3.1.4 in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from dm-control>=1.0.3->d4rl) (3.1.6)
Requirement already satisfied: protobuf>=3.19.4 in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from dm-control>=1.0.3->d4rl) (4.21.11)
Requirement already satisfied: labmaze in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from dm-control>=1.0.3->d4rl) (1.0.6)
Requirement already satisfied: dm-env in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from dm-control>=1.0.3->d4rl) (1.5)
Requirement already satisfied: mujoco>=2.3.1.post1 in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from dm-control>=1.0.3->d4rl) (2.3.1.post1)
Requirement already satisfied: pyparsing>=3.0.0 in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from dm-control>=1.0.3->d4rl) (3.0.9)
Requirement already satisfied: setuptools!=50.0.0 in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from dm-control>=1.0.3->d4rl) (65.5.0)
Requirement already satisfied: lxml in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from dm-control>=1.0.3->d4rl) (4.9.2)
Requirement already satisfied: tqdm in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from dm-control>=1.0.3->d4rl) (4.64.1)
Requirement already satisfied: requests in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from dm-control>=1.0.3->d4rl) (2.28.1)
Requirement already satisfied: scipy in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from dm-control>=1.0.3->d4rl) (1.9.3)
Requirement already satisfied: absl-py>=0.7.0 in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from dm-control>=1.0.3->d4rl) (1.3.0)
Requirement already satisfied: dm-tree!=0.1.2 in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from dm-control>=1.0.3->d4rl) (0.1.7)
Requirement already satisfied: glfw in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from dm-control>=1.0.3->d4rl) (2.5.5)
Requirement already satisfied: pyglet<=1.5.0,>=1.4.0 in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from gym<0.25.0->d4rl) (1.5.0)
Requirement already satisfied: cloudpickle<1.7.0,>=1.2.0 in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from gym<0.25.0->d4rl) (1.6.0)
Requirement already satisfied: Pillow<=7.2.0 in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from gym<0.25.0->d4rl) (7.2.0)
Requirement already satisfied: cffi>=1.10 in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from mujoco-py->d4rl) (1.15.1)
Requirement already satisfied: Cython>=0.27.2 in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from mujoco-py->d4rl) (0.29.32)
Requirement already satisfied: fasteners~=0.15 in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from mujoco-py->d4rl) (0.18)
Requirement already satisfied: imageio>=2.1.2 in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from mujoco-py->d4rl) (2.9.0)
Requirement already satisfied: pycparser in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from cffi>=1.10->mujoco-py->d4rl) (2.21)
Requirement already satisfied: future in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from pyglet<=1.5.0,>=1.4.0->gym<0.25.0->d4rl) (0.18.2)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from requests->dm-control>=1.0.3->d4rl) (1.26.13)
Requirement already satisfied: certifi>=2017.4.17 in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from requests->dm-control>=1.0.3->d4rl) (2022.9.24)
Requirement already satisfied: charset-normalizer<3,>=2 in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from requests->dm-control>=1.0.3->d4rl) (2.1.1)
Requirement already satisfied: idna<4,>=2.5 in /home/qinliang/software/anaconda3/envs/trajectory/lib/python3.8/site-packages (from requests->dm-control>=1.0.3->d4rl) (3.4)
And now, here is the new output of this command
python scripts/train.py --dataset halfcheetah-medium-v2
Out put :
python scripts/train.py --dataset halfcheetah-medium-v2
pybullet build time: May 20 2022 19:44:17
[ utils/setup ] Reading config: config.offline:halfcheetah_medium_v2
[ utils/setup ] Not using overrides | config: config.offline | dataset: halfcheetah_medium_v2
[ utils/setup ] Saved args to logs/halfcheetah-medium-v2/gpt/azure/args.json
Traceback (most recent call last):
File "/home/**/software/anaconda3/envs/trajectory/lib/python3.8/site-packages/gym/envs/registration.py", line 121, in spec
return self.env_specs[id]
KeyError: 'halfcheetah-medium-v2'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "scripts/train.py", line 26, in <module>
env = datasets.load_environment(args.dataset)
File "/home/**/Desktop/TT/trajectory-transformer/trajectory/datasets/d4rl.py", line 83, in load_environment
wrapped_env = gym.make(name)
File "/home/**/software/anaconda3/envs/trajectory/lib/python3.8/site-packages/gym/envs/registration.py", line 145, in make
return registry.make(id, **kwargs)
File "/home/**/software/anaconda3/envs/trajectory/lib/python3.8/site-packages/gym/envs/registration.py", line 89, in make
spec = self.spec(path)
File "/home/**/software/anaconda3/envs/trajectory/lib/python3.8/site-packages/gym/envs/registration.py", line 131, in spec
raise error.UnregisteredEnv('No registered env with id: {}'.format(id))
gym.error.UnregisteredEnv: No registered env with id: halfcheetah-medium-v2
@jannerm
I suppose you might not install mujoco-py or mujoco correctly.
Could you provide a pip freeze
and conda list
?
@jannerm pip freeze:
absl-py==1.3.0
certifi @ file:///croot/certifi_1665076670883/work/certifi
cffi==1.15.1
charset-normalizer==2.1.1
click==8.1.3
cloudpickle==1.6.0
cycler @ file:///tmp/build/80754af9/cycler_1637851556182/work
Cython==0.29.32
cytoolz @ file:///croot/cytoolz_1667465931118/work
d4rl==1.1
dask @ file:///tmp/abs_994957d9-ec12-411f-b953-c010f9d489d10hj3gz4k/croots/recipe/dask-core_1658513209934/work
dm-control==1.0.9
dm-env==1.5
dm-tree==0.1.7
fasteners==0.18
fsspec @ file:///croot/fsspec_1670336592807/work
future==0.18.2
gitdb==4.0.10
GitPython==3.1.29
glfw==2.5.5
gym==0.18.0
h5py==3.7.0
idna==3.4
imagecodecs @ file:///opt/conda/conda-bld/imagecodecs_1664561985385/work
imageio @ file:///tmp/build/80754af9/imageio_1617700267927/work
kiwisolver @ file:///opt/conda/conda-bld/kiwisolver_1653292039266/work
labmaze==1.0.6
locket @ file:///opt/conda/conda-bld/locket_1652903118915/work
lxml==4.9.2
matplotlib @ file:///tmp/build/80754af9/matplotlib-suite_1613407855456/work
mkl-fft==1.3.1
mkl-random @ file:///tmp/build/80754af9/mkl_random_1626186064646/work
mkl-service==2.4.0
mujoco==2.3.1.post1
mujoco-py==2.1.2.14
mypy-extensions==0.4.3
networkx @ file:///opt/conda/conda-bld/networkx_1657784097507/work
numpy==1.23.5
olefile @ file:///Users/ktietz/demo/mc3/conda-bld/olefile_1629805411829/work
packaging @ file:///tmp/build/80754af9/packaging_1637314298585/work
partd @ file:///opt/conda/conda-bld/partd_1647245470509/work
Pillow @ file:///tmp/build/80754af9/pillow_1594307295532/work
ply==3.11
protobuf==4.21.11
pybullet==3.2.5
pycparser==2.21
pyglet==1.5.0
PyOpenGL==3.1.6
pyparsing @ file:///opt/conda/conda-bld/pyparsing_1661452539315/work
PyQt5-sip==12.11.0
python-dateutil @ file:///tmp/build/80754af9/python-dateutil_1626374649649/work
PyWavelets @ file:///croot/pywavelets_1670425177960/work
PyYAML @ file:///croot/pyyaml_1670514731622/work
requests==2.28.1
scikit-image==0.17.2
scikit-video==1.1.11
scipy==1.9.3
sip @ file:///tmp/abs_44cd77b_pu/croots/recipe/sip_1659012365470/work
six @ file:///tmp/build/80754af9/six_1644875935023/work
smmap==5.0.0
termcolor==2.1.1
tifffile @ file:///tmp/build/80754af9/tifffile_1627275862826/work
toml @ file:///tmp/build/80754af9/toml_1616166611790/work
toolz @ file:///croot/toolz_1667464077321/work
torch==1.9.1+cu111
tornado @ file:///opt/conda/conda-bld/tornado_1662061693373/work
tqdm==4.64.1
-e git+https://github.com/jannerm/trajectory-transformer.git@8834a6ed04ceeab8fdb9465e145c6e041c05d71b#egg=trajectory
typed-argument-parser==1.7.2
typing-inspect==0.8.0
typing_extensions==4.4.0
urllib3==1.26.13
conda list:
# packages in environment at /home/qinliang/software/anaconda3/envs/trajectory:
#
# Name Version Build Channel
_libgcc_mutex 0.1 main
_openmp_mutex 5.1 1_gnu
absl-py 1.3.0 pypi_0 pypi
blas 1.0 mkl
blosc 1.21.0 h4ff587b_1
brotli 1.0.9 h5eee18b_7
brotli-bin 1.0.9 h5eee18b_7
brunsli 0.1 h2531618_0
bzip2 1.0.8 h7b6447c_0
c-ares 1.18.1 h7f8727e_0
ca-certificates 2022.10.11 h06a4308_0
certifi 2022.9.24 py38h06a4308_0
cffi 1.15.1 pypi_0 pypi
cfitsio 3.470 h5893167_7
charls 2.2.0 h2531618_0
charset-normalizer 2.1.1 pypi_0 pypi
click 8.1.3 pypi_0 pypi
cloudpickle 1.6.0 pypi_0 pypi
cycler 0.11.0 pyhd3eb1b0_0
cython 0.29.32 pypi_0 pypi
cytoolz 0.12.0 py38h5eee18b_0
d4rl 1.1 pypi_0 pypi
dask-core 2022.7.0 py38h06a4308_0
dbus 1.13.18 hb2f20db_0
dm-control 1.0.9 pypi_0 pypi
dm-env 1.5 pypi_0 pypi
dm-tree 0.1.7 pypi_0 pypi
expat 2.4.9 h6a678d5_0
fasteners 0.18 pypi_0 pypi
fftw 3.3.9 h27cfd23_1
fontconfig 2.14.1 hef1e5e3_0
freetype 2.12.1 h4a9f257_0
fsspec 2022.11.0 py38h06a4308_0
future 0.18.2 pypi_0 pypi
giflib 5.2.1 h7b6447c_0
gitdb 4.0.10 pypi_0 pypi
gitpython 3.1.29 pypi_0 pypi
glfw 2.5.5 pypi_0 pypi
glib 2.69.1 he621ea3_2
gst-plugins-base 1.14.0 h8213a91_2
gstreamer 1.14.0 h28cd5cc_2
gym 0.18.0 pypi_0 pypi
h5py 3.7.0 pypi_0 pypi
icu 58.2 he6710b0_3
idna 3.4 pypi_0 pypi
imagecodecs 2021.8.26 py38hf0132c2_1
imageio 2.9.0 pyhd3eb1b0_0
intel-openmp 2021.4.0 h06a4308_3561
jpeg 9e h7f8727e_0
jxrlib 1.1 h7b6447c_2
kiwisolver 1.4.2 py38h295c915_0
krb5 1.19.2 hac12032_0
labmaze 1.0.6 pypi_0 pypi
lcms2 2.12 h3be6417_0
ld_impl_linux-64 2.38 h1181459_1
lerc 3.0 h295c915_0
libaec 1.0.4 he6710b0_1
libbrotlicommon 1.0.9 h5eee18b_7
libbrotlidec 1.0.9 h5eee18b_7
libbrotlienc 1.0.9 h5eee18b_7
libclang 10.0.1 default_hb85057a_2
libcurl 7.86.0 h91b91d3_0
libdeflate 1.8 h7f8727e_5
libedit 3.1.20221030 h5eee18b_0
libev 4.33 h7f8727e_1
libevent 2.1.12 h8f2d780_0
libffi 3.4.2 h6a678d5_6
libgcc-ng 11.2.0 h1234567_1
libgfortran-ng 11.2.0 h00389a5_1
libgfortran5 11.2.0 h1234567_1
libgomp 11.2.0 h1234567_1
libllvm10 10.0.1 hbcb73fb_5
libnghttp2 1.46.0 hce63b2e_0
libpng 1.6.37 hbc83047_0
libpq 12.9 h16c4e8d_3
libssh2 1.10.0 h8f2d780_0
libstdcxx-ng 11.2.0 h1234567_1
libtiff 4.4.0 hecacb30_2
libwebp 1.2.4 h11a3e52_0
libwebp-base 1.2.4 h5eee18b_0
libxcb 1.15 h7f8727e_0
libxkbcommon 1.0.1 hfa300c1_0
libxml2 2.9.14 h74e7548_0
libxslt 1.1.35 h4e12654_0
libzopfli 1.0.3 he6710b0_0
locket 1.0.0 py38h06a4308_0
lxml 4.9.2 pypi_0 pypi
lz4-c 1.9.4 h6a678d5_0
matplotlib 3.3.4 py38h06a4308_0
matplotlib-base 3.3.4 py38h62a2d02_0
mkl 2021.4.0 h06a4308_640
mkl-service 2.4.0 py38h7f8727e_0
mkl_fft 1.3.1 py38hd3c417c_0
mkl_random 1.2.2 py38h51133e4_0
mujoco 2.3.1.post1 pypi_0 pypi
mujoco-py 2.1.2.14 pypi_0 pypi
mypy-extensions 0.4.3 pypi_0 pypi
ncurses 6.3 h5eee18b_3
networkx 2.8.4 py38h06a4308_0
nspr 4.33 h295c915_0
nss 3.74 h0370c37_0
numpy 1.23.5 pypi_0 pypi
numpy-base 1.23.4 py38h31eccc5_0
olefile 0.46 pyhd3eb1b0_0
openjpeg 2.4.0 h3ad879b_0
openssl 1.1.1s h7f8727e_0
packaging 21.3 pyhd3eb1b0_0
partd 1.2.0 pyhd3eb1b0_1
patchelf 0.15.0 h6a678d5_0
pcre 8.45 h295c915_0
pillow 7.2.0 py38hb39fc2d_0
pip 22.3.1 py38h06a4308_0
ply 3.11 py38_0
protobuf 4.21.11 pypi_0 pypi
pybullet 3.2.5 pypi_0 pypi
pycparser 2.21 pypi_0 pypi
pyglet 1.5.0 pypi_0 pypi
pyopengl 3.1.6 pypi_0 pypi
pyparsing 3.0.9 py38h06a4308_0
pyqt 5.15.7 py38h6a678d5_1
pyqt5-sip 12.11.0 py38h6a678d5_1
python 3.8.15 h7a1cb2a_2
python-dateutil 2.8.2 pyhd3eb1b0_0
pywavelets 1.4.1 py38h5eee18b_0
pyyaml 6.0 py38h5eee18b_1
qt-main 5.15.2 h327a75a_7
qt-webengine 5.15.9 hd2b0992_4
qtwebkit 5.212 h4eab89a_4
readline 8.2 h5eee18b_0
requests 2.28.1 pypi_0 pypi
scikit-image 0.17.2 py38hdf5156a_0
scikit-video 1.1.11 pypi_0 pypi
scipy 1.9.3 pypi_0 pypi
setuptools 65.5.0 py38h06a4308_0
sip 6.6.2 py38h6a678d5_0
six 1.16.0 pyhd3eb1b0_1
smmap 5.0.0 pypi_0 pypi
snappy 1.1.9 h295c915_0
sqlite 3.40.0 h5082296_0
termcolor 2.1.1 pypi_0 pypi
tifffile 2021.7.2 pyhd3eb1b0_2
tk 8.6.12 h1ccaba5_0
toml 0.10.2 pyhd3eb1b0_0
toolz 0.12.0 py38h06a4308_0
torch 1.9.1+cu111 pypi_0 pypi
tornado 6.2 py38h5eee18b_0
tqdm 4.64.1 pypi_0 pypi
trajectory 0.0.0 dev_0 <develop>
typed-argument-parser 1.7.2 pypi_0 pypi
typing-extensions 4.4.0 pypi_0 pypi
typing-inspect 0.8.0 pypi_0 pypi
urllib3 1.26.13 pypi_0 pypi
wheel 0.37.1 pyhd3eb1b0_0
xz 5.2.8 h5eee18b_0
yaml 0.2.5 h7b6447c_0
zfp 0.5.5 h295c915_6
zlib 1.2.13 h5eee18b_0
zstd 1.5.2 ha4553b6_0
It looks like you are missing mjrl
. I'm not sure why -- this should be installed as a dependency of d4rl
. Could you try pip install git+https://github.com/aravindr93/mjrl@3871d93763d3b49c4741e6daeaebbc605fe140dc
?
@jannerm Thank you for your patient and kindness ! It works!
Great to hear!
Hi, I run this project without Docker, just Vscode. However, when I run
It goes like this: How can I fix it ? Thank you so much.