facebookresearch / agenthive

AgentHive provides the primitives and helpers for a seamless usage of robohive within TorchRL.
30 stars 4 forks source link

Installation problems #17

Open lklimkiewicz7 opened 9 months ago

lklimkiewicz7 commented 9 months ago

I'm having problem with installation.

When I'm directly following Getting started instructions I'm receiving following error during rlhive import:

Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "/home/lklimkiewicz/reps/robots/agenthive_test1/agenthive/rlhive/__init__.py", line 6, in <module>
    from .envs import (
  File "/home/lklimkiewicz/reps/robots/agenthive_test1/agenthive/rlhive/envs.py", line 16, in <module>
    visual_obs_keys_wt = robohive.envs.multi_task.substeps1.visual_obs_keys_wt

To fix this particular error I downgraded robohive from 0.6 to 0.5, but I stumbled on another one:

Warning: Unused kwargs found: {'frameskip': 1, 'return_dict': True}
Configuring a new session for Franka_kitchen_sim(sim)
Reading robot-configurations from /home/lklimkiewicz/miniconda3/envs/agenthive_v4/lib/python3.8/site-packages/robohive/envs/multi_task/substeps1/../common/slidecabinet/franka_slidecabinet.config
Configuring component franka
Configuring component slidecabinet
Traceback (most recent call last):
  File "<string>", line 4, in <module>
  File "/home/lklimkiewicz/miniconda3/envs/agenthive_v4/lib/python3.8/site-packages/torchrl/envs/libs/gym.py", line 395, in __call__
    instance: GymWrapper = super().__call__(*args, **kwargs)
  File "/home/lklimkiewicz/miniconda3/envs/agenthive_v4/lib/python3.8/site-packages/torchrl/envs/common.py", line 134, in __call__
    instance: EnvBase = super().__call__(*args, **kwargs)
  File "/home/lklimkiewicz/miniconda3/envs/agenthive_v4/lib/python3.8/site-packages/torchrl/envs/libs/gym.py", line 953, in __init__
    super().__init__(**kwargs)
  File "/home/lklimkiewicz/miniconda3/envs/agenthive_v4/lib/python3.8/site-packages/torchrl/envs/libs/gym.py", line 504, in __init__
    super().__init__(**kwargs)
  File "/home/lklimkiewicz/miniconda3/envs/agenthive_v4/lib/python3.8/site-packages/torchrl/envs/common.py", line 2028, in __init__
    self._env = self._build_env(**kwargs)  # writes the self._env attribute
  File "/home/lklimkiewicz/miniconda3/envs/agenthive_v4/lib/python3.8/site-packages/rlhive/rl_envs.py", line 44, in _build_env
    env = self.lib.make(
  File "/home/lklimkiewicz/miniconda3/envs/agenthive_v4/lib/python3.8/site-packages/gym/envs/registration.py", line 156, in make
    return registry.make(id, **kwargs)
  File "/home/lklimkiewicz/miniconda3/envs/agenthive_v4/lib/python3.8/site-packages/gym/envs/registration.py", line 101, in make
    env = spec.make(**kwargs)
  File "/home/lklimkiewicz/miniconda3/envs/agenthive_v4/lib/python3.8/site-packages/gym/envs/registration.py", line 73, in make
    env = cls(**_kwargs)
  File "/home/lklimkiewicz/miniconda3/envs/agenthive_v4/lib/python3.8/site-packages/robohive/envs/multi_task/common/franka_appliance_v1.py", line 43, in __init__
    self._setup(**kwargs)
  File "/home/lklimkiewicz/miniconda3/envs/agenthive_v4/lib/python3.8/site-packages/robohive/envs/multi_task/common/franka_appliance_v1.py", line 52, in _setup
    super()._setup(
  File "/home/lklimkiewicz/miniconda3/envs/agenthive_v4/lib/python3.8/site-packages/robohive/envs/multi_task/multi_task_base_v1.py", line 112, in _setup
    super()._setup(obs_keys=obs_keys_wt,
  File "/home/lklimkiewicz/miniconda3/envs/agenthive_v4/lib/python3.8/site-packages/robohive/envs/env_base.py", line 130, in _setup
    self._setup_rgb_encoders(self.visual_keys, device=None)
  File "/home/lklimkiewicz/miniconda3/envs/agenthive_v4/lib/python3.8/site-packages/robohive/envs/env_base.py", line 162, in _setup_rgb_encoders
    if key.startswith('rgb'):
AttributeError: 'dict' object has no attribute 'startswith'
Closing Franka_kitchen_sim(sim)

Output from pip freeze:

absl-py==2.0.0
antlr4-python3-runtime==4.9.3
appdirs==1.4.4
certifi==2023.7.22
cffi==1.16.0
charset-normalizer==3.3.1
click==8.1.7
cloudpickle==1.2.2
contourpy==1.1.1
cycler==0.12.1
Cython==0.29.36
dm-control==1.0.11
dm-env==1.6
dm-tree==0.1.8
docker-pycreds==0.4.0
fasteners==0.15
ffmpeg==1.4
filelock==3.12.4
flatten-dict==0.4.2
fonttools==4.43.1
free-mujoco-py==2.1.6
fsspec==2023.10.0
gitdb==4.0.11
GitPython==3.1.40
glfw==1.12.0
gym==0.13.0
h5py==3.7.0
hydra-core==1.3.2
idna==3.4
imageio==2.31.6
importlib-resources==6.1.0
Jinja2==3.1.2
kiwisolver==1.4.5
labmaze==1.0.6
lxml==4.9.3
MarkupSafe==2.1.3
matplotlib==3.7.3
monotonic==1.6
mpmath==1.3.0
mujoco==2.3.3
networkx==3.1
numpy==1.24.4
nvidia-cublas-cu12==12.1.3.1
nvidia-cuda-cupti-cu12==12.1.105
nvidia-cuda-nvrtc-cu12==12.1.105
nvidia-cuda-runtime-cu12==12.1.105
nvidia-cudnn-cu12==8.9.2.26
nvidia-cufft-cu12==11.0.2.54
nvidia-curand-cu12==10.3.2.106
nvidia-cusolver-cu12==11.4.5.107
nvidia-cusparse-cu12==12.1.0.106
nvidia-nccl-cu12==2.18.1
nvidia-nvjitlink-cu12==12.3.52
nvidia-nvtx-cu12==12.1.105
omegaconf==2.3.0
packaging==23.2
pathtools==0.1.2
Pillow==10.0.1
protobuf==4.24.4
psutil==5.9.6
pycparser==2.21
pyglet==2.0.9
PyOpenGL==3.1.7
pyparsing==3.1.1
python-dateutil==2.8.2
PyYAML==6.0.1
requests==2.31.0
rlhive @ git+https://github.com/facebookresearch/agenthive.git@8941ac9f911453ab84ba3e47ba7700241608d1ce
robohive==0.5.0
scipy==1.10.1
sentry-sdk==1.32.0
setproctitle==1.3.3
six==1.16.0
sk-video==1.1.10
smmap==5.0.1
sympy==1.12
tensordict @ git+https://github.com/pytorch-labs/tensordict@6a9f8e354848455054a74f61e74187bb0368677a
termcolor==2.3.0
torch==2.1.0
torchaudio==2.1.0
torchrl @ git+https://github.com/pytorch/rl.git@c7d4764e787e4be903f7b5f03b6008f00e9b23a1
torchvision==0.16.0
tqdm==4.66.1
triton==2.1.0
typing_extensions==4.8.0
urllib3==2.0.7
wandb==0.15.12
zipp==3.17.0
BrightMoonStar commented 8 months ago

I encountered the same problem, can you help check it, thank you! @Jdvakil @vikashplus @vmoens @ShahRutav

ShahRutav commented 8 months ago

Hi, the AgentHive wrapper is not updated with the latest versions of RoboHive at the moment. Can you try to run the BC script which does not use AgentHive's env wrapper?

vmoens commented 7 months ago

See this fix of the instructions The stable versions should work from now on!