MAC系统使用Pycharm配置SMAC环境

编程入门 行业动态 更新时间:2024-10-25 22:33:46

MAC系统使用Pycharm配置SMAC<a href=https://www.elefans.com/category/jswz/34/1771403.html style=环境"/>

MAC系统使用Pycharm配置SMAC环境

1.安装星际争霸游戏环境

Mac Python3.9 星际争霸_现实里的大梦想家的博客-CSDN博客

 安装过后在访达中进行确认

2.使用Pycharm创建新的3.8/3.6 python环境

3.安装Pytorch

Mac系统在Pycharm终端 安装Gym和Pytorch_现实里的大梦想家的博客-CSDN博客

至此可以再测试下pytorch是否安装好了:

python
import torch

4.下载及配置pymarl

在Pycharm环境下用终端打开 输入命令

一定要用终端窗口下载! 软连接可做可不做 可以先测试一下环境

git clone .git

 链接后目录为:

 5.下载及配置smac

下面再就是安装SMAC了,smac的作用就是作为游戏的接口 同样在终端进行安装!

pip install git+.git

若失败 可以参考这篇文章 

SMAC安装的最好方法_nj_aqh的博客-CSDN博客_smac安装

或用这个命令

git clone .git
pip install -e smac/

6.测试

做完上述的smac配置步骤就可以进行测试smac环境了:

python -m smac.examples.random_agents

 后续可参考

星际争霸pymarl的环境搭建(pymarl+smac)_zhoupingqi2017的博客-CSDN博客

7.测试pymarl的配置

先下载:

pip install sacred
pip install PyYAML==3.13

进入pymarl文件,在终端输入:

python src/main.py --config=qmix --env-config=sc2 with env_args.map_name=2s3z t_max=20000

运行后可能会有报错:

OMP: Error #15: Initializing libiomp5.dylib, but found libiomp5.dylib already initialized.
OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see /.

它提示设置环境变量,因此可以在main的最开头所有import之前加入:

import os
os.environ["KMP_DUPLICATE_LIB_OK"]="TRUE"

运行成功!在控制台打印信息

 

更多推荐

MAC系统使用Pycharm配置SMAC环境

本文发布于:2024-03-07 05:17:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1716941.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:环境   系统   MAC   SMAC   Pycharm

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!