网站建设成都公司哪家好天津市建设工程信息网专家网
简介:
本项目主要是记录在安装github开源项目D4RL时的要点,以及部分安装经验。D4RL库是主要用于深度强化相关研究的重要开源数据库,可与stable baseline3等框架结合使用。
D4RL库的安装历程及成功经验
本项目主要是记录在安装github开源项目D4RL时的要点,以及部分安装经验。D4RL库是主要用于深度强化相关研究的重要开源数据库,可与stable baseline3等框架结合使用。

0 系统环境配置
由于D4RL库在windows端安装需要配置的内容比较复杂,因此采用ubuntu系统进行环境配置,主要采用的系统版本及cuda toolkit版本为
ubuntu 16.04
nvidia toolkit 11.8
1 虚拟环境创建
其次,通过conda创建环境为
conda create -n d4rl python=3.9 -yconda activate d4rl
其次安装需要的库
pip install "numpy<2"pip install gym==0.25.1pip install "cython<3"
需要注意的是D4RL库也可采用GPU驱动,需要安装torch。由于我的电脑上使用的是cuda toolkit 11.8,因此安装pytorch的命令为
pip install torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 --index-url https://download.pytorch.org/whl/cu118
此外,还需要通过pip+git安装D4RL库
pip install git+https://github.com/rail-berkeley/d4rl@master#egg=d4rl
最后安装修改 ELF(Executable and Linkable Format)文件的工具patchelf
sudo apt-get install patchelf
2 其他文件的准备
在/home/user 文件夹下创建文件夹.mujoco
并使用下列链接下载mujoco 2.1.0版本
https://github.com/google-deepmind/mujoco/releases/tag/2.1.0

将其中的mujoco210文件夹解压至该文件夹下,文件结构为
.
└── mujoco210├── bin│ ├── basic│ ├── compile│ ├── derivative│ ├── libglewegl.so│ ├── libglewosmesa.so│ ├── libglew.so│ ├── libglfw3.a│ ├── libglfw.so.3│ ├── libmujoco210nogl.so│ ├── libmujoco210.so│ ├── record│ ├── simulate│ ├── testspeed│ └── testxml├── include│ ├── glfw3.h│ ├── mjdata.h│ ├── mjmodel.h│ ├── mjrender.h│ ├── mjui.h│ ├── mjvisualize.h│ ├── mjxmacro.h│ ├── mujoco.h│ ├── uitools.c│ └── uitools.h├── model│ ├── arm26.xml│ ├── carpet.png│ ├── cloth.xml│ ├── grid1pin.xml│ ├── grid1.xml│ ├── grid2pin.xml│ ├── grid2.xml│ ├── hammock.xml│ ├── humanoid100.xml│ ├── humanoid.xml│ ├── loop.xml│ ├── marble.png│ ├── particle.xml│ ├── rope.xml│ ├── scene.xml│ ├── softbox.xml│ ├── softcylinder.xml│ ├── softellipsoid.xml│ └── sponge.png├── sample│ ├── basic.cc│ ├── compile.cc│ ├── derivative.cc│ ├── Makefile│ ├── record.cc│ ├── simulate.cc│ ├── testspeed.cc│ └── testxml.cc└── THIRD_PARTY_NOTICES5 directories, 52 files
然后修改bashrc,加入如下代码
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/cbh/.mujoco