#Please help me set up ml agents
1 messages · Page 1 of 1 (latest)
What tutorial? I recommend following the guidelines in the docs.
I read the documentation, nothing worked out, and the video on YouTube is from Russia
Well, you'll need to provide details on your setup and issues.
Ideally, reset everything and flow the docs. Then if there are still issues, share the info here.
And of course Download Conda
Conda is one of the steps in the docs. But to be honest, it's not a hard requirement. It's just for setting up a virtual environment.
Could also use venv or some other simpler alternative.
What to do
Can it be fixed?
For starters, avoid taking photos. Make it screenshots.
Second, this is not really an error, and honestly it's probably not a problem at all.
I'm not sure if it's fixabale. It seems to be an common bug lately.
I downloaded everything, but the result is zero
@onyx flint And what is my mistake
📃 Large Code Blocks
Use links to services like:
https://paste.mod.gg/, https://hastebin.skyra.pw/, https://paste.ofcode.org/, https://paste.myst.rs/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
The errors mean that a component or an object having the component was destroyed, yet you still try to access it.
And what if the object itself exists, but there is a mistake And what if the object itself exists, but the error writes
Then you're either looking at the wrong object, or it was destroyed at the time of the error.
You need to use backticks: ```
using UnityEngine;
using Unity.MLAgents;
using Unity.MLAgents.Sensors;
using Unity.MLAgents.Actuators;
public class plAge : Agent
{
[SerializeField] private Transform targetTransform;
[SerializeField] private Material winMatearil;
[SerializeField] private Material loseMatest;
[SerializeField] private MeshRenderer plabeMeshRederer;
public override void CollectObservations(VectorSensor sensor)
{
sensor.AddObservation(transform.localPosition);
sensor.AddObservation(targetTransform.localPosition);
}
public override void OnActionReceived(ActionBuffers actions)
{
float moveX = actions.ContinuousActions[0];
float moveZ = actions.ContinuousActions[1];
float speed = 25f;
transform.localPosition += new Vector3(moveX, 0, moveZ) * Time.deltaTime * speed;
}
public override void Heuristic(in ActionBuffers actionsOut)
{
ActionSegment<float> continuonsActions = actionsOut.ContinuousActions;
continuonsActions[0] = Input.GetAxisRaw("Horizontal");
continuonsActions[1] = Input.GetAxisRaw("Vertical");
}
private void OnTriggerEnter(Collider other)
{
if(other.TryGetComponent<Wall>(out Wall wall))
{
SetReward(-1f);
plabeMeshRederer.material = loseMatest;
EndEpisode();
}
if(other.TryGetComponent<Tar>(out Tar tar))
{
SetReward(+1f);
plabeMeshRederer.material = winMatearil;
EndEpisode();
}
}
}
Click one of the errors and share it's details in the bottom.
This seems to be thrown by the inspector ui, not your code. I'd assume the Agent script ui specifically. Is there actually an issue with it? Because I think you can just ignore this error.
Same error, different name.
That's the same.
Same.
This one is different.
I still tried to control it, but it didn't work.
Seems like an issue with your setup.
I'd try running their sample and see if it works. If it does, then your setup is wrong. Refer to the sample and documentation for the correct setup and code:
https://docs.unity3d.com/Packages/com.unity.ml-agents@4.0/manual/Sample.html
This is definitely wrong. You're not supposed to use the Agent base class.
It doesn't move and when I lift it, it falls down sharply.
This doesn't look like the sample scene from the docs.
I don't have any of their scenes, and if I download them from GitHub, everything is pink, there are no models or textures.
The samples should be installable with the package(might need to click the samples button in the package manager).
Environments are located in Project/Assets/ML-Agents/Examples
https://docs.unity3d.com/Packages/com.unity.ml-agents@4.0/manual/Learning-Environment-Examples.html
As for everything being pink, you probably need to convert the materials to use shaders of your selected render pipeline. This is a completely different and unrelated issue that you should know how to solve.
There's a script error and everything is rosy.
clicked and here it is
I explained about pink - it's the materials not being compatible with your render pipeline.
As for the errors this is probably some missing package.
Probably Recorder package.
https://docs.unity3d.com/Packages/com.unity.recorder@5.1/manual/index.html
It seems to be listed in the package dependencies, so it was supposed to be installed with the ml agents package.🤔
Ah, nevermind. It's listed in the github repo packages manifset, not the dependencies. So you need to install it manually.
I saw in the documentation that they have a CPU, but I don’t have one. Maybe that’s the problem?
I can see many problems, like the model reference missing, Agent component assigned. Your setup is not correct at all. Did you have a look at the samples yet or not? You should look at the samples, and read the documentation to understand how to use the package...
I added the Decision Requester component and it started flying around the map.
I don't understand at all what I'm doing