Search Unity

  1. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  2. Dismiss Notice

Gym Unity - Baselines

Discussion in 'ML-Agents' started by ademord, May 27, 2021.

  1. ademord

    ademord

    Joined:
    Mar 22, 2021
    Posts:
    24
    Hello guys,

    I finished my environment in unity and now I am trying to "export it to gym" to try different algorithms (i will do my own implementations afterwards). I am trying Baselines now and I exported the environment as:

    env = UnityToGymWrapper(unity_env, uint8_visual=True, flatten_branched=True, allow_multiple_obs=True)


    And now, from this line:

    model = PPO(MlpPolicy, env, verbose=0)


    I am getting the error:

    NotImplementedError: Tuple(Box(-inf, inf, (91,), float32)) observation space is not supported


    What could I do? I am a bit lost.
     
  2. vincentpierre

    vincentpierre

    Unity Technologies

    Joined:
    May 5, 2017
    Posts:
    142
    PPO baselines does not support observations of type Tuple(Box(-inf, inf, (91,), float32)) (which I think corresponds to flat vector observations of 91 floats). If you want to use baselines, you need to create an environment with observations and actions that baselines can work with.
     
  3. ademord

    ademord

    Joined:
    Mar 22, 2021
    Posts:
    24
    I am using raycasts and one boolean (so yes vector obs as you mention). How can i know what kind of observations does baselines work with? do i check the algorithm - which obs input it supports or do i try to change my obs? i just need some direction.
     
  4. vincentpierre

    vincentpierre

    Unity Technologies

    Joined:
    May 5, 2017
    Posts:
    142
    I have not worked with PPO baselines in a while, I think you will have better luck looking at their documentation or issues page. If my memory is correct, it should work on single visual observations but I really am not sure.
     
unityunity