Search Unity

Question OnActionReceived is not called

Discussion in 'ML-Agents' started by unity_iEoJVjfH1vdjOw, Mar 11, 2021.

  1. unity_iEoJVjfH1vdjOw

    unity_iEoJVjfH1vdjOw

    Joined:
    Feb 12, 2021
    Posts:
    2
    My agent is initialized, CollectObservation runs once, OnEpisodeBegin runs on every death but OnActionReceived is never called. What can I do?
     
    CloudyVR likes this.
  2. unity_iEoJVjfH1vdjOw

    unity_iEoJVjfH1vdjOw

    Joined:
    Feb 12, 2021
    Posts:
    2
    I tried RequestAction(), vectorAction is full of zeros every time...
     
    CloudyVR likes this.
  3. awjuliani

    awjuliani

    Unity Technologies

    Joined:
    Mar 1, 2017
    Posts:
    69
    Hello,

    Are you running a training session, or are you simply performing inference with a heuristic method? If it is inference with a heuristic, then you should expect all zeros, unless you have written a custom heuristic.
     
  4. spacestar1705

    spacestar1705

    Joined:
    May 2, 2022
    Posts:
    13
    Hi I am facing the same problem, I am running training.
     
    CloudyVR likes this.
  5. smallg2023

    smallg2023

    Joined:
    Sep 2, 2018
    Posts:
    144
    make sure you have a decision requester attached (or you are manually calling the requests via code)
     
  6. bhunterd

    bhunterd

    Joined:
    Oct 6, 2016
    Posts:
    27
    Problem can be if you forgot to add your custom script inherit from Agent. Insted Unity added Agent script itself.
     
  7. WDBO

    WDBO

    Joined:
    Jul 5, 2022
    Posts:
    2
    are you have the"Decision Requester"Component?