主体框架参考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 版本均可
conda install pytorch=1.6.0 cpuonly -c pytorch
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的值, 如下图所示
7. 测试
运行命令:
python -m smac.examples.random_agents
https://github.com/oxwhirl/smac
https://github.com/oxwhirl/pymarl