-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnityActionException: behavior 3DBall?team=1 needs a continuous input of dimension (0, 2) #5204
Comments
Hi @nagybalint25
The error message is wrong and I will work to resolve this. Thank you for raising this issue. |
Thank you very much for your kind and quick reply! Absolutely solved my
problem.
Vincent-Pierre BERGES ***@***.***> ezt írta (időpont: 2021.
márc. 31., Sze, 20:15):
… Hi @nagybalint25 <https://github.com/nagybalint25>
I was able to reproduce the issue. The problem is that your agent is done,
do the environment must reset :
The following code should do the trick :
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()
o,r,d,_ = env.step(env.action_space.sample()) #random action
if d:
env.reset()
env.close()
if __name__ == '__main__':
main()
The error message is wrong and I will work to resolve this. Thank you for
raising this issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5204 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASZG3QM26W56G2EUGOYKR5LTGNRD7ANCNFSM42E2OF7Q>
.
|
Thanks @vincentpierre ! Since the fix has been merged I'll close it. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
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:
Environment:
The text was updated successfully, but these errors were encountered: