-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
bugIssue describes a potential bug in ml-agents.Issue describes a potential bug in ml-agents.
Description
Running a version of 3DBall, where I've deleted all agents except for one. Whenever I issue an action using Gym (with the wrapper), for example taking a random action using
env.action_space.sample()
I get an error:
The behavior 3DBall?team=1 needs a continuous input of dimension (0, 2) for (<number of agents>, <action size>) but received input of dimension (1, 2)
There clearly is an agent in my executable, and mlagents-learn
works fine too.
My code is as follows:
from mlagents_envs.environment import UnityEnvironment
from gym_unity.envs import UnityToGymWrapper
gym.logger.set_level(40)
def main():
unity_env = UnityEnvironment(file_name="3dballv2")
env = UnityToGymWrapper(unity_env, uint8_visual=True,allow_multiple_obs=True)
env.reset()
for _ in range(1000):
env.render()
env.step(env.action_space.sample()) #random action
env.close()
if __name__ == '__main__':
main()
Environment:
- Unity Version: Unity 2020.1f1
- OS + version: Windows 10
- ML-Agents version: Release 15
- Torch version: 1.7.1
- Environment: 3DBalls
Metadata
Metadata
Assignees
Labels
bugIssue describes a potential bug in ml-agents.Issue describes a potential bug in ml-agents.