Windows下安装星际争霸2的多智能体强化学习平台pymarl

主体框架参考https://blog.csdn.net/xyp99/article/details/108718906.

安装环境

windows10, CPU only

安装步骤

1. StarCraft Ⅱ 安装,约30G。

2. 创建conda环境

  • conda create -n pymarl python=3.7 -y
  • conda activate pymarl   

注意事项:

  • 如果执行conda create -n pymarl python=3.7 -y时出现CondaHTTPError, 可以参考我之前的博客(CondaHTTPError的解决之道, https://blog.csdn.net/kiding_k/article/details/110939128);
  • 如果执行conda activate pymarl时出现Conda activate错误,可以参考我之前的博客(“conda activate“错误的一个解决之道, https://blog.csdn.net/kiding_k/article/details/110939895); 

3. 安装pytorch

cpu/gpu 版本均可

  • cpu conda install pytorch=1.6.0 cpuonly -c pytorch
  • gpu conda install pytorch==1.6.0 torchvision cudatoolkit=x.x -c pytorch -y

4. 安装python库

  • pip install sacred numpy scipy matplotlib seaborn pyyaml pygame pytest probscale imageio snakeviz tensorboard-logger

5. 安装SMAC(StarCraft Multi-Agent Challenge)

可以使用下面的命令进行SMAC的安装

  • pip install git+https://github.com/oxwhirl/smac.git

或者可以将SMAC下载到本地(可以不用git, 直接进行下载), 然后进行安装

  • git clone https://github.com/oxwhirl/smac.git
    pip install smac/

6. 地图下载

下载 SMAC Maps ((https://github.com/oxwhirl/smac/releases/download/v0.1-beta1/SMAC_Maps.zip)) , 并将地图数据提取到 $SC2PATH/Maps 目录中. 

注意事项: $SC2PATH为本地安装的星际争霸地址, 而且需要在环境变量中明确设置$SC2PATH的值, 如下图所示

Windows下安装星际争霸2的多智能体强化学习平台pymarl_第1张图片

7. 测试

运行命令:

python -m smac.examples.random_agents

安装检测

https://github.com/oxwhirl/smac

MADRL算法性能测试

https://github.com/oxwhirl/pymarl

你可能感兴趣的:(python,多智能体强化学习)