问题本记录(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报错,完事打击咔咔咔咔
相关推荐
郝学胜-神的一滴1 小时前
[简化版 GAMES 101] 计算机图形学 13:从光栅化到着色——赋予三维像素光影灵魂
c++·计算机视觉·unity·godot·图形渲染·opengl·unreal
晓13131 小时前
【Cocos Creator 3.x】篇——第五章 项目实战优化技术
前端·javascript·游戏引擎
fqkw61 小时前
unity 安装MCP +uvx
unity·游戏引擎
魔士于安18 小时前
unity 音乐会场景 unity2022
游戏·unity·游戏引擎·贴图·模型
一线灵19 小时前
Axmol 3.x 输入系统重构:从 Touch/Mouse 到统一 Pointer,再到现代 InputField
重构·游戏引擎
Zwarwolf19 小时前
Godot零散知识点项目汇总
游戏引擎·godot
Mediary20 小时前
Unity is running with Administrator privileges, which isnot supported...
unity
游乐码1 天前
Unity基础(十四)场景异步加载
unity·游戏引擎
mxwin1 天前
Unity Shader URP:法线在空间变换上的特殊性
unity·游戏引擎·shader
nnsix1 天前
Unity 动态批处理、静态批处理、GPU Instaning、SRP Batcher 笔记
笔记·unity·单一职责原则