Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Getting "Fewer Observations made than vector observation size" error during training

Discussion in 'ML-Agents' started by MapleMeese, Aug 31, 2020.

  1. MapleMeese

    MapleMeese

    Joined:
    May 1, 2020
    Posts:
    18
    I'm working on a project, and during each training session, no matter what, around 30 minutes in, I get the "Fewer observations made than vector observation size. The observations will be padded" error. I don't see anything wrong with the code, and have no idea what's causing this especially since it occurs 30 minutes in. Any ideas?
     
  2. ReinierJ

    ReinierJ

    Joined:
    Jul 10, 2020
    Posts:
    10
    This warning means that during execution of your CollectObservations method, you provide fewer observations with AddObservation than you specified as the vector observation size of your agent in the inspector in Unity.
     
  3. MapleMeese

    MapleMeese

    Joined:
    May 1, 2020
    Posts:
    18
    Yep, but I'm confused about why this is happening, as this error only pops up 30 minutes into training. I'm confused on what's suddenly causing fewer observations to be sent, after 30 minutes of it working fine.
     
  4. ReinierJ

    ReinierJ

    Joined:
    Jul 10, 2020
    Posts:
    10
    This never happened to me, so without any further information (such as the code in your CollectObservations method) I'm afraid it's hard to diagnose your problem. Are there any conditionals in the method? Try to debug your CollectObservations method (e.g. with debug statements) to find out what's going wrong, in which cases it does not add all observations it should add, and which observations are missing.
     
  5. MapleMeese

    MapleMeese

    Joined:
    May 1, 2020
    Posts:
    18
    Here are my 2 scripts.
    https://pastebin.com/AZC23wTN
    https://pastebin.com/0rk2p5CH

    I've been looking at them for days, and I can't find anything that could cause the problem. However, On one run I got an error saying the ball rigidbody had been destroyed, but I can't find anything in the scripts that would have destroyed it. I really don't understand what's causing this issue.
     
  6. andrewcoh_unity

    andrewcoh_unity

    Unity Technologies

    Joined:
    Sep 5, 2019
    Posts:
    162
    It's possible that one of the observations from the ball is empty if the ball is being destroyed. You could check to make sure that the observations from the ball have the same size at every step.
     
  7. MapleMeese

    MapleMeese

    Joined:
    May 1, 2020
    Posts:
    18
    yea, that's my guess, but I have no idea why the ball is getting destroyed. If you look at my scripts, it should not be getting destroyed at any point.