Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question After I trained a model, can I modify Sensor tag and continue training the same model?

Discussion in 'ML-Agents' started by MarkMaa, May 12, 2023.

  1. MarkMaa


    Jan 20, 2020
    Because I trained a model, changed the tags in RayPerceptionSensor, and when I try to continue training my model I get the error after I hit play:

    RuntimeError: The size of tensor a (91) must match the size of tensor b (74) at non-singleton dimension 1

    Then I set my old tags back and I can continue training again. That means, I CANNOT modify tags in Sensor, right? Or there is a way to extend/modify old model with new data, remove some old data?
  2. Luke-Houlihan


    Jun 26, 2007
    You are correct you cannot add or remove tags in the sensor after training. Each tag is treated as a separate detection and requires a new observation, you cannot change the number of observations after training the model.

    I believe you can however modify the existing tags as long as the total number of detected tags is not changed. No idea what that would do to the trained policy though.