Unity ML Agents Package Manager is not importing Actuator script

Viewed 3642

I want to test the Unity ML example "3D Ball". So, I set up environment:

  1. Imported the ML Agents Package by Unity Package Manager.
  2. Copied the ML Agent example Assets from Unity's official GitHub to My Project File.

Then, I opened the example scene and played that scene. But every code which contains "using Unity.MLAgents.Actuators" fails with the following error:

Assets\test.cs(5,22): error CS0234: The type or namespace name 'Actuators' does not exist in the namespace 'Unity.MLAgents' (are you missing an assembly reference?)

So, I've tried to find MLAgents.Actuator module's source code. But I didn't find anything yet.

Someone said Actuator Module is applied after ML Agent 1.0.3, but I imported the lasted version (v. 1.0.4).

How can I import the ML Agents package properly? Every YouTube tutorial does not show the problem I've encountered.

Here is my environment:

  • Unity version: Unity 2020.1.0f
  • ML Agents version: version 1.0.4
  • ML Agents example: version Release 7
6 Answers

Update the package to a 1.4.0-preview or later (depending on your Unity version, you may need to change some package manager settings to be able to see preview packages). Get the examples from a tag that corresponds to the 1.0.x package, for example com.unity.ml-agents_1.0.6

You have to manually install it from the repository you cloned.

I added the project from "Unity Hub" rather than inserting asset folder to a new project. And then everything works fine. Even the preview packages like [com.unity.ml-agents.extensions": "file:../../com.unity.ml-agents.extensions] added automatically to the project from my project directory!

If you need to use the 1.0.x pacakage, make sure you're getting the examples from a compatible version (not the master branch). For example, here's the 1.0.2 tag: github.com/Unity-Technologies/ml-agents/tree/…. Looks like 1.03 and 1.0.4 tags are missing but I'll update them tomorrow. – celion Sep 27 '20 at 20:27

Celion had the right answer

I have the same problem, I am very new to Unity. I figured out it is something with the versioning. You need to use the proper version of the package. By installing from the Unity Registry, I was not able to install the last version.

I just install the package from the Disk. Here follow the Install the com.unity.ml-agents Unity package. It fixed my problem.

Unity.MLAgents.Actuators this package is in preview till this date, if you want to use this package you need to update your MLAgents package from package manager.

Related