问题本记录(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

  1. 指定py3.7创建虚拟环境

C:\Users\User\Desktop\MEP-Clash report\Models\PathPlanning_Unity\DRL_PathPlanning20241114>py -3.7 -m venv venv

  1. 启动虚拟环境

C:\Users\User\Desktop\MEP-Clash report\Models\PathPlanning_Unity\DRL_PathPlanning20241114>venv\scripts\activate

  1. 安装pip

(venv) C:\Users\User\Desktop\MEP-Clash report\Models\PathPlanning_Unity\DRL_PathPlanning20241114>py -m pip install --upgrade pip

  1. 下载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

  1. 安装mlagents,指定版本:0.28.0

(venv) C:\Users\User\Desktop\MEP-Clash report\Models\PathPlanning_Unity\DRL_PathPlanning20241114>pip install mlagents==0.28.0

  1. 检查是否安装成功

(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)

  1. 仅仅将↑中的,两项放到建的Unity中
  1. 修改manifest.json,添加↓两项

"com.unity.ml-agents": "file:../com.unity.ml-agents",

"com.unity.ml-agents.extensions": "file:../com.unity.ml-agents.extensions"

  1. 打开Unity,自动导入,0报错,完事打击咔咔咔咔
相关推荐
年少无知且疯狂7 小时前
【Unity】Shader spine动画冻结效果
unity·spine
淡海水8 小时前
05-02-源码-Boehm GC标记阶段
算法·unity·c#·游戏引擎·gc
淡海水12 小时前
05-03-源码-Boehm GC分配与碎片管理
开发语言·算法·unity·c#·游戏引擎·gc
WarPigs2 天前
Unity无法修改Assembly-CSharp.csproj错误
unity
FairGuard手游加固3 天前
手游加固怎么做?SO、IL2CPP、AssetBundle 与运行时保护详解
安全·游戏·unity
阿松爱学习4 天前
【Unity开发】监听Scene场景事件
unity·c#
xiaogai_gai4 天前
BOM 物料清单同步实战:金蝶云星空 → 四化智造 MES 修改场景深度拆解
unity·游戏引擎
淡海水5 天前
03-03-架构篇-SGen GC架构解析
unity·架构·c#·gc·sgen
/**书香门第*/5 天前
Cocos Creator 打螺丝游戏的实现
游戏引擎·cocos2d·螺丝·打螺丝
萌萌的提莫队长5 天前
Unity相机捕捉,图像识别,抠像+合成
opencv·unity