问题本记录(2):Unity+机器学习
最近在搞 Unity+机器学习
遇到了版本冲突问题 来来回回一天之内 创建了七八九十个虚拟环境以后
终于找到了匹配的版本!!!!
版本记录:
Unity:2021.3.44f1c1
ML-agents:ml-agents-release_19 (下载地址:发布 ·Unity-Technologies/ml-agents)
python:3.7(下载地址:Python Releases for Windows | Python.org)
torch:1.7.0
mlagents:0.28.0
cmd记录:
1. 定位到Unity project:
C:\Users\User>cd C:\Users\User\Desktop\MEP-Clash report\Models\PathPlanning_Unity\DRL_PathPlanning20241114
2. 指定py3.7创建虚拟环境
C:\Users\User\Desktop\MEP-Clash report\Models\PathPlanning_Unity\DRL_PathPlanning20241114>py -3.7 -m venv venv
3. 启动虚拟环境
C:\Users\User\Desktop\MEP-Clash report\Models\PathPlanning_Unity\DRL_PathPlanning20241114>venv\scripts\activate
4. 安装pip
(venv) C:\Users\User\Desktop\MEP-Clash report\Models\PathPlanning_Unity\DRL_PathPlanning20241114>py -m pip install --upgrade pip
5. 下载torch(注意一定不要开vpn)
(venv) C:\Users\User\Desktop\MEP-Clash report\Models\PathPlanning_Unity\DRL_PathPlanning20241114>pip install torch==1.7.0 -f https://download.pytorch.org/whl/torch_stable.html
6. 安装mlagents,指定版本:0.28.0
(venv) C:\Users\User\Desktop\MEP-Clash report\Models\PathPlanning_Unity\DRL_PathPlanning20241114>pip install mlagents==0.28.0
7. 检查是否安装成功
(venv) C:\Users\User\Desktop\MEP-Clash report\Models\PathPlanning_Unity\DRL_PathPlanning20241114>mlagents-learn --help
完事大吉↓ python端的环境配完了!!!
Unity端配置记录:
1. 下载
ML-agents:ml-agents-release_19 (下载地址:发布 ·Unity-Technologies/ml-agents)
2. 仅仅将↑中的,两项放到建的Unity中
3. 修改manifest.json,添加↓两项
"com.unity.ml-agents": "file:../com.unity.ml-agents",
"com.unity.ml-agents.extensions": "file:../com.unity.ml-agents.extensions"
4. 打开Unity,自动导入,0报错,完事打击咔咔咔咔
原文地址:https://blog.csdn.net/yyyyyy3802/article/details/143779399
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!