Search Unity

Question [Solve]RuntimeError: The size of tensor a (#) must match the size of tensor b (#) at non-singleton..

Discussion in 'ML-Agents' started by maxkcy, Mar 3, 2023.

  1. maxkcy

    maxkcy

    Joined:
    Oct 11, 2021
    Posts:
    62
    RuntimeError: The size of tensor a (3) must match the size of tensor b (15) at non-singleton dimension 1
    ^ in cmd promt not editor, as the very last message as it abruptly stops

    This error started occuring after I set observation stacks to 5 for the camera sensor of my agent.
    The training is fine for aproximately 10k steps before this error occurs and it exports the results and shuts down.
    Does anyone know what's going on here?
     
    Last edited: Mar 3, 2023
    samvilm likes this.
  2. samvilm

    samvilm

    Joined:
    Jan 17, 2021
    Posts:
    43
    same problem
     
  3. maxkcy

    maxkcy

    Joined:
    Oct 11, 2021
    Posts:
    62
    [Solved] I initialized from a new run-id, and although I'm unsure if this helped too, but I made "observable attribute handling" in behavior parameters to examine all.
     
    Last edited: Mar 5, 2023
  4. metaliccrystal

    metaliccrystal

    Joined:
    Aug 24, 2022
    Posts:
    4
    are you taking already trained model and building more trainning over that? like --iniitalize-from=""
    If this is the case then this occurs due to incompatibility with the previous trained model. Like if you have changed vector observation size or ray perception count etc.
    So if you make it same with the previous model then error will remove