Farama-Foundation / D4RL-Evaluations

Apache License 2.0
187 stars 27 forks source link

[BEAR] Problems with the installation #22

Closed SamuelePolimi closed 3 years ago

SamuelePolimi commented 3 years ago

Dear all,

I encountered many difficulties during the installation of BEAR, mainly due to conflicting dependencies between packages. Also, the version of pytorch specified looks to be wrong, since it is not possible to reduce over multiple dimensions (e.g, torch.mean(x, dim=(1,2)) is not allowed) with pythorch==0.4.1. I managed to fix the errors, and I report here how I solved them.

This is probably one of the many possible ways one can solve the aforementioned problems.

SOLUTION

cd bear
conda create -n rlkit python=3.7.0
conda activate rlkit
conda install -c conda-forge/label/cf202003 glfw
conda install pip
conda install -c conda-forge box2d-py
conda install pytorch==1.2.0 torchvision cudatoolkit=10.0 -c pytorch

conda install cython ipython joblib lockfile mako matplotlib mkl numba path.py python-dateutil scipy patchelf pygame cloudpickle gitpython parso

conda install -c conda-forge gym
conda install -c conda-forge ipdb

pip install gtimer
pip install numpy

pip install -e .

Download d4rl from the official repository and cd d4rl. Change the setup.py with the following

from distutils.core import setup
from setuptools import find_packages

setup(
    name='d4rl',
    version='1.1',
    install_requires=['gym', 
                      'numpy', 
                      'mujoco_py', 
                      'pybullet',
                      'h5py', 
                      'termcolor', # adept_envs dependency
                      'click',  # adept_envs dependency
#                      'dm_control @ git+git://github.com/deepmind/dm_control@master#egg=dm_control',
                      'dm_control',
                      'mjrl @ git+git://github.com/aravindr93/mjrl@master#egg=mjrl'],
    packages=find_packages(),
    package_data={'d4rl': ['locomotion/assets/*',
                           'hand_manipulation_suite/assets/*',
                           'hand_manipulation_suite/Adroit/*',
                           'hand_manipulation_suite/Adroit/gallery/*',
                           'hand_manipulation_suite/Adroit/resources/*',
                           'hand_manipulation_suite/Adroit/resources/meshes/*',
                           'hand_manipulation_suite/Adroit/resources/textures/*',
                           ]},
    include_package_data=True,
)

Install the library with pip install . and pip install dm _control.

P.S. A big thank to Joao Carvalho for finding this solution @jacarvalho https://github.com/jacarvalho.