Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Ray Perception Sensor not registering observations

Discussion in 'ML-Agents' started by Brian16446, Mar 28, 2020.

  1. Brian16446

    Brian16446

    Joined:
    Apr 3, 2019
    Posts:
    1
    I have a car set up with raycasts using the ray perception sensor to detect 3 tags. For some reason, I am getting the warning in unity: Fewer observations (0) made than vector observation size (45).

    I think because there are no observations, it is not learning. Why does this have 0 observations? I thought the Ray Perception Sensor automatically collected observations and passed them to the behavior parameters?

    Here is a screenshot of the scripts:

    Ray Perception Sensor:


    Behaviour Parameters:
     
  2. LexVolkov

    LexVolkov

    Joined:
    Sep 14, 2014
    Posts:
    62
    yes, automatically. therefore, it is not necessary to enter the number of ray sensors in the component of observations. In the component you enter only those sensors that you entered in your code.
     
  3. christophergoy

    christophergoy

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    735
    Hi @Brian16446,
    @LexVolkov is correct. The vector observations on the BrainParameters are referencing the observations you make in your code within the CollectObservations method on Agent. The size for the sensors is added automatically for you. Let us know if you have any further questions.
     
  4. KVTeja_512

    KVTeja_512

    Joined:
    Apr 19, 2021
    Posts:
    4
    How do I debug log the game object that the ray is hitting?