Linux系统安装Pymarl,配置SMAC环境
1.下载星际争霸2到服务器中wget http://blzdistsc2-a.akamaihd.net/Linux/SC2.4.6.2.69232.zip解压:
unzip SC2.4.6.2.69232.zip 解压密码:
iagreetotheeula 2.安装Pymarl的conda环境
创建pymarl环境:
conda create -n pymarl python=3.7 -y 激活环境:
conda activate pymarl 安装pytorch:
conda install pytorch==1.6.0 torchvision cudatoolkit -c pytorch -y 避免安装教程中cudatoolkit=x.x版本限制导致安装包之间的冲突,我们去掉了这个限制。 pip安装:
pip install sacred numpy scipy matplotlib seaborn pyyaml pygame pytest probscale imageio snakeviz tensorboard-logger 安装SMAC:
pip install git+https://github.com/oxwhirl/smac.git 拉取Pymarl文件:
git clone https://github.com/oxwhirl/pymarl 3.环境配置
设置SC2PATH环境:
打开bashrc:
vim ~/.bashrc 添加:
export SC2PATH=~/StarCraftII/ 更改bashrc后,更新环境:
source ~/.bashrc 添加地图:
wget https://link.zhihu.com/?target=https%3A//github.com/oxwhirl/smac/releases/download/v0.1-beta1/SMAC_Maps.zip 解压到StarCraftII/Maps目录下.
4.测试环境
测试SMAC环境:
python -m smac.examples.random_agents 报错:
image.png
protobuf版本太高,降级:
pip install protobuf==3.19.0 Ubuntu中终端中会出现SMAC运行信息:
image.png
cd到pymarl文件夹下,测试Pymarl:
python src/main.py --config=qmix --env-config=sc2 with env_args.map_name=2s3z 报错:
image.png
将pyyaml降级:
pip install pyyaml==5.4.1再次进行测试,测试成功:
image.png
页:
[1]