【记录】强化学习环境legged_gym配置
legged_gym 配置
legged_gym代码仓库为:https://github.com/leggedrobotics/legged_gym
rsl_rl代码仓库为:https://github.com/leggedrobotics/rsl_rl
conda环境:Python3.8
pip换源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/
阿里云: https://mirrors.aliyun.com/pypi/simple/
清华大学: https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学: https://pypi.mirrors.ustc.edu.cn/simple/
如果需要换回来 pip config unset global.index-url
pip install numpy==1.23.5
pip install tensorboard
## 创建新的conda环境
conda activate Issac_Gym38 python=3.8
## 安装torch1.13.1+cu117
pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu117
## 在https://developer.nvidia.com/isaac-gym/download安装Preview4
cd isaacgym/python && pip install -e .
## 测试安装是否成功
cd examples && python 1080_balls_of_solitude.py
## 使用rsl_rl库
mkdir Env_Pkg
cd Env_Pkg
git clone https://github.com/leggedrobotics/rsl_rl.git
cd rsl_rl
git checkout v1.0.2
pip install -e .
## 安装legged_gym
cd legged_gym
pip install -e .
问题:pytorch安装慢!
解决方案:换pytorch国内镜像站用浏览器的多线程工具下载 https://mirrors.aliyun.com/pytorch-wheels/
效果:20kb/s -> 300kb/s -> 5mb/s,节约了几个钟头(如果pip可以多线程下载包的话直接挂梯子用原来的url下应该也行)
原命令:
pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu117
解决方案(我的效果:200kb/s -> 2mb/s):把这个命令的包,用Ctrl+F在 https://mirror.sjtu.edu.cn/pytorch-wheels/cu117 手动寻找下列三个文件
torchaudio-0.13.1+cu117-cp38-cp38-linux_x86_64.whl
torchvision-0.14.1+cu117-cp38-cp38-linux_x86_64.whl
torch-1.13.1+cu117-cp38-cp38-linux_x86_64.whl
下载存到对应环境,执行pip install torchaudio-0.13.1+cu117-cp38-cp38-linux_x86_64.whl torchvision-0.14.1+cu117-cp38-cp38-linux_x86_64.whl torch-1.13.1+cu117-cp38-cp38-linux_x86_64.whl 将它们安装
测试:安装是否成功
cd examples && python 1080_balls_of_solitude.py
git clone https://github.com/leggedrobotics/legged_gym.git